No description
Find a file
2024-11-01 08:11:44 +00:00
api_v1 first commit 2024-11-01 08:00:42 +00:00
node_modules first commit 2024-11-01 08:00:42 +00:00
public first commit 2024-11-01 08:00:42 +00:00
db.json first commit 2024-11-01 08:00:42 +00:00
index.html Upload files to "/" 2024-11-01 08:11:44 +00:00
license.md first commit 2024-11-01 08:00:42 +00:00
package-lock.json first commit 2024-11-01 08:00:42 +00:00
package.json first commit 2024-11-01 08:00:42 +00:00
readme.md Update readme.md 2024-11-01 08:09:23 +00:00

Protected REST API with json-server and JWT

This project allows us to use an API Rest to develop in the frontend with mock datas before the backend is finished.

Install

Clone this repo on your machine and before run npm i to install all dependences.

Start/Stop servers

Description Script
Start server without auth npm start
Start server with auth npm run start-auth

Tools

Description Script
Generate user hashed passwords npm run hash

Endpoints for auth server

Endpoint Description
localhost:3000/auth/login Login user
localhost:3000/photos Products list (token needed)

json-server api reference

How use


Inspired in this post by Techiediaries

This project is licensed under the terms of the MIT license.