Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

techiediaries/fake-api-jwt-json-server

Repository files navigation

JSONServer + JWT Auth

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

Implemented End-points: login,register

Install

$ npm install
$ npm run start-auth

Might need to run

npm audit fix

How to login/register?

You can login/register by sending a POST request to

POST http://localhost:8000/auth/login
POST http://localhost:8000/auth/register

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>

Check out these tutorials:

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /