Skip to content

A Fake API with JWT Authentication using json-server and jsonwebtoken

Notifications You must be signed in to change notification settings

fabricadecodigo/fake-api-jwt-json-server

 
 

Repository files navigation

JSONServer + JWT Auth

A Fake REST API using json-server with JWT authentication. You can find the complete tutorial here

Install

$ npm install
$ npm run api-auth

How to login?

You can login by sending a POST request to

POST http://localhost:3000/auth/login

with the following data

{
  "email": "nilson@email.com",
  "password":"nilson"
}

You should receive an access token with the following format

{
   "access_token": "<ACCESS_TOKEN>"
}

You should send this authorization with any request to the protected endpoints

Authorization: Bearer <ACCESS_TOKEN>

About

A Fake API with JWT Authentication using json-server and jsonwebtoken

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%