Giter Club home page Giter Club logo

nodejs-cloudinary-configurations-course's Introduction

NodeJS & Cloudinary API

This is an introductory course into cloudinary for NodeJS Developers

DISCLAIMER: This repo is derived from the cloudinary training program verifiable at this github repository: cloudinary training program. You can find all the source code in that repository. This is for practical and learning purposes and to help explain/emphasize on more aspects of working with Cloudinary and NodeJS.

NOTE: You can download or clone this repo (after which you will run npm install or npm i to install the neccessary packages for running and testing the project.) or if you want to follow the steps in setting up your own: below is a quick guide on how to do so.

Setup and Installation

  • Download and install NodeJS from the following URL Installation Link
  • Verify the installation by typing node --version on your terminal
  • Also verify your npm version by typing npm --version

Setting up a NodeJS Project

Cloudinary Account

Cloudinary Access

  • In nodejs and other technologies, in-order to access and perform manipulations/transformations on your assests on cloudinary; you need to get the following information/secrets from your cloudinary dashboard:
  1. Cloud Name
  2. API Key
  3. API Secret
  4. Or API Environment variable - we will emphasize on this later on.

These are used for communicating with cloudinary's API and signing your requests made unto cloudinary.

NOTE: Don't expose the above keys/secrets, store them as prescribed here or use any other secure way to store your secrets.

Securing Cloudinary keys/scerets

  • Install dotenv package using the following command npm i dotenv or npm install dotenv.
  • Create a .env file within the root of your application.
  • Store the following variable inside yout .env file: CLOUDINARY_URL=<get and paste your cloudinary url here>. Please remove these < and > when storing your secret.
  • Create a .gitignore file in your project and add .env into it as done within the .gitignore file in this repository so as to avoid pushing this unto Github for those using it.
  • Next install the cloudinary package using npm i cloudinary.

Testing Credentials Setup

  • Create a testCredentials.js and populate the file with the following code:
    require("dotenv").config();
    const cloudinary = require("cloudinary").v2;

    console.log(cloudinary.config().cloud_name);
    console.log(cloudinary.config().api_key);
    console.log(cloudinary.config().api_secret);

To test if your credentials have been properly configured/store please run the following command: node testCredentials.js and you should see your credentials being logged out.

Running the Examples in this Repo

  • For any example you wish to run simply copy the code within that given file and paste in your own project and run it following the same command as above replacing testCredentials with the filename you are trying to run.

nodejs-cloudinary-configurations-course's People

Contributors

njohprince avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.