You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Fake REST API using json-server with JWT authentication. You can find the [complete tutorial here](https://www.techiediaries.com/fake-api-jwt-json-server/)
4
+
5
+
## Install
6
+
7
+
```bash
8
+
$ npm install
9
+
$ npm run api-auth
10
+
```
11
+
12
+
## How to login?
13
+
14
+
You can login by sending a POST request to
15
+
16
+
```
17
+
POST http://localhost:3000/auth/login
18
+
```
19
+
with the following data
20
+
21
+
```
22
+
{
23
+
"email": "nilson@email.com",
24
+
"password":"nilson"
25
+
}
26
+
```
27
+
28
+
You should receive an access token with the following format
29
+
30
+
```
31
+
{
32
+
"access_token": "<ACCESS_TOKEN>"
33
+
}
34
+
```
35
+
36
+
37
+
You should send this authorization with any request to the protected endpoints
0 commit comments