Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/techiediaries/fake-api-jwt-json-server
A Fake API with JWT Authentication using json-server and jsonwebtoken
https://github.com/techiediaries/fake-api-jwt-json-server
faker json-server jsonwebtoken jwt jwt-authentication
Last synced: about 2 months ago
JSON representation
A Fake API with JWT Authentication using json-server and jsonwebtoken
- Host: GitHub
- URL: https://github.com/techiediaries/fake-api-jwt-json-server
- Owner: techiediaries
- Created: 2018-01-15T19:29:07.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-22T05:51:40.000Z (almost 2 years ago)
- Last Synced: 2024-07-05T15:06:16.500Z (3 months ago)
- Topics: faker, json-server, jsonwebtoken, jwt, jwt-authentication
- Language: JavaScript
- Size: 94.7 KB
- Stars: 284
- Watchers: 9
- Forks: 215
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSONServer + JWT Auth
A Fake REST API using json-server with JWT authentication.
Implemented End-points: login,register
## Install
```bash
$ 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": "[email protected]",
"password":"nilson"
}
```You should receive an access token with the following format
```
{
"access_token": ""
}
```You should send this authorization with any request to the protected endpoints
```
Authorization: Bearer
```Check out these tutorials:
- [Mocking a REST API Back-End for Your Angular App with JSON-Server and Faker.js](https://www.techiediaries.com/angular-mock-backend)
- [Building a Fake and JWT Protected REST API with json-server](https://www.techiediaries.com/fake-api-jwt-json-server)
- [Angular 9 Tutorial: Build an Example App with Angular CLI, Angular Router, HttpClient & Angular Material](https://www.shabang.dev/angular-tutorial-build-an-example-app-with-angular-cli-router-httpclient-and-angular-material/)