A secure Node Js API to manage login, signup and logout operations. This API uses Express Js , Mongo and JWT (json web token) for Authentication.
Open Terminal (cmd) cd YourProjectFolderName Then install all of these modules one by one: npm install node npm install express npm install bcrypt npm install body-parser npm intsall mongoose npm install jsonwebtoken npm i install dotenv
Now, Search Mongo Atlas on Google and create an account. Once you are logged in there follow these steps: 1. Go to Database access and set up your Database username and password. 2. Go to Network access and type 0.0.0.0/0 or Allow access from anywhere and click confirm. 3. Go to Database under Depolyment tab, Click connect --> Connect your application ---> copy the Address.
4. Go to app.js in your project folder, and paste this link in mongoose.connect('');
*make sure to replace the '<password>' with your Database password.
1. Create a .env file, and write your Secret Key as ACCESS_TOKEN = write any thing you want for eg: 1. Create .env file 2. Type ACESS_TOKEN = This is a dummy text 3. Save .env 2. Type node server.js on your terminal to run this API. 3. Install Postman to send and get request from the Database.
For Any Query or help feel free to contact me at aqibaltaf99@gmail.com And if you liked this API, Make sure to give it a star