Skip to content

Fake Api to support React Native and Expo to-do cases

Notifications You must be signed in to change notification settings

musulton/fake-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:3001/auth/login
POST http://localhost:3001/auth/register

with the following data

{
  "email": "admin@mail.com",
  "password":"password"
}

You should receive an access token with the following format

{
   "accessToken": "<ACCESS_TOKEN>"
}

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

Authorization: Bearer <ACCESS_TOKEN>

Check out these tutorials:

About

Fake Api to support React Native and Expo to-do cases

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published