Get a full fake REST API with zero coding in less than 30 seconds (NodeJS + JSON Server + JSON Webtoken).
Support JWT Bearer authentication:
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
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:
database.json:    "protected_resources": {
        "users": ["GET", "POST", "PUT", "PATCH", "DELETE"],
        "products": ["POST", "PUT", "PATCH", "DELETE"]
    }
/login, method POST, using email & password in resource users:    {
        "email": "",
        "password": ""
    }
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.