Nodejs Restful API with jwt and mongodb Connection using mongoose.
First you need to have a mongodb installation. You can refer here to install an instance:
Then install nodejs
After that you'll have access to yarn (Nodejs Package Manager). Now you can install additionnal dependencies
# Go inside the project
cd nodejs-restful-api
# Install all dependencies
yarn
# For nodejs live reload when file changes in the directory are detected install nodemon
npm install -g nodemon
# You start the api by hitting
yarn
# Or
node server.js
Routes
{ get; }
* Retrieve Informations about users
- /users
- /users/:id
* Register informations or Login
{ post; }
- /auth/register
- /auth/login
* Go to user profile
{ get; }
- /auth/me
* Edit user's informations
{ patch; }
- /auth/edit
User
-_id [Generated]
- name
- surname
- email
- password
* profile