This project was developed with the purpose of facilitating our journey, when we need to make a system of authenticity and we do not know where to start. Here is an expensive and straightforward example of how to set up an authentication API with JWT Token and NodeJS
- ES6 support via babel
- REST resources as middleware via resource-router-middleware
- CORS support via cors
- Body Parsing via body-parser
- PM2 Monitoring - Production via pm2
- NodeRestful via node-restful
- BCrypts support via bcryptjs
- JSON Web Tokens support via jsonwebtoken
- Mongoose support via mongoose
- Path support via path
- FS support via fs
# clone it
git clone https://github.com/caioorg/node-jwt.git
cd node-jwt
# Make it your own
rm -rf .git && git init && npm init
# Install dependencies
yarn install
# Start project development
yarn run dev
# If you want to start production
yarn run build
If you want to validate the route operation by POSTMAN:
POST - Register User -> /auth/register
POST - Authenticate User -> /auth/login
GET - Validate Token -> /checking
This link was made available with the documentation, how to make the requests via POSTMAN.