It's a simple Node REST JWT authentication server that is built with Mongoose and Passport.
git clone <this_repo_url>
cd node-jwt-auth
yarn install
ornpm install
- Go to
config/database.js
and set MongoDB server address (You can also change server secret, but it's not necessary) yarn run server
ornpm run server
- The server starts running on
http:localhost:3000/api/
- Request body:
{"username": "your_username", "email": "[email protected]", "password": "your_password"}
- Returns register status
- Request body:
{"username": "your_username", "password": "your_password"}
- Returns JWT token
- Request header [Authorization]:
<JWT_token>
- Returns list of games