Follow instructions to install the latest version of Node.js for your platform in the Node.js Website After installation, make sure you have Node and npm installed by running the following commands:
node --version
npm --version
If the version of each of them appears, they are installed correctly.
Once you have Node.js and npm installed, install dependencies by opening a command prompt and run the following command:
npm install
This will install all the required packages within the package.json
file.
-
Express.Js is a lightweight backend microservices framework. Express is required to handle requests and responses.
-
MongoDB is a lightweight NoSQL database that is used to store data as documents.
-
Mongoose is a MongoDB ODM that we will use to handle connection to MongoDB.
-
Passport.Js is a node module used to control Authentication/Authorization in the application.
With Node.Js and MongoDB installed, you will need to set your environment variables by doing the following:
- Create a new file in the main directory with the name
.env
. - Copy the contents of the
.env.example
to the newly-created.env
file. - Fill the marked spaces with your own environment variables.
- Note: You can uncomment the line
#NODE_ENV=production
to set the Node Environment to production.
From within the directory run the following command for development environment:
npm run start-dev
OR this command for production environment:
npm run start-prod
this will start the server on your local environment on a specific PORT.
Tests can be run using Postman
Import the collection in the file Skimmit.postman_collection.json
to Postman then run your tests,
but make sure you set your base_url.
- Base URL: this application is deployd on Heroku with a base url
https://Skimmit-api.herokuapp.com
. However, if you run it locally it will be hosted at the default,http://127.0.0.1:3000/
. - API Documentation: You can find full API documentation here Skimmit API Documentation
- Authentication: A full explanation of the authentication techniques in the full API Documentation.