Getting data from the API only after successful authentication using JSON Web Token (JSON).
For development, you will only need Node.js and a node global package, npm, installed in your environment.
You can install nodejs and npm easily with apt install, just run the following commands.
> sudo apt install nodejs
> sudo apt install npmIf the installation is successful, you can run the following command.
> node --version
v16.20.2
> npm --version
8.19.4If you need to update npm, you can make it using npm! Cool right? After running the following command, open the command line again and be happy.
> npm install npm -g> git clone https://github.com/kaustubh0201/Random-Number.git
> cd Random-Number
> npm installCreate .env then add MongoDB URI in it. You will need to make a cluster on MongoDB Atlas or start the MongoDB server locally.
Also put the JWT_SECRET token in this file.
> npm start