datle204.github.io

Fake REST API NodeJS

Get a full fake REST API with zero coding in less than 30 seconds (NodeJS + JSON Server + JSON Webtoken).

Support JWT Bearer authentication:

Vietnamese documents

Getting started

Clone this repository

git clone https://github.com/robinhuy/fake-rest-api-nodejs.git

Install dependencies

cd fake-rest-api-nodejs
npm install

Run server

npm start

Modify your data

All the data was placed in database.json. Edit it to suit your purpose.

You can use https://mockaroo.com/ to mock data, and publish your code to https://heroku.com/ to get a Public API.

Note:

    "protected_resources": {
        "users": ["GET", "POST", "PUT", "PATCH", "DELETE"],
        "products": ["POST", "PUT", "PATCH", "DELETE"]
    }
    {
        "email": "",
        "password": ""
    }

Access & modify API

Please view detailed document in https://github.com/typicode/json-server/blob/master/README.md#table-of-contents

If you want to change logic of authentication, please edit file server.js.