Skip to content

alecsandermarques/fake-api-jwt-json-server

Repository files navigation

JSON Server + JWT Auth

A Fake REST API using json-server with JWT authentication.

Implemented endpoint: login,register

Install

$ yarn or npm install
$ yarn start or npm run start

How to create a new user?

Sending a POST request to

POST http://localhost:3333/auth/register

with the following data

{
  "name": "Admin",
  "email": "[email protected]",
  "password":"admin"
}

How to login?

Sending a POST request to

POST http://localhost:3333/auth/login

with the following data

{
  "email": "[email protected]",
  "password":"admin"
}

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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published