json-server is a simple server to generate REST API.

Install:

npm install -g json-server
cat ex/db.json
  ##> {
  ##>   "posts": [
  ##>     { "id": 1, "title": "json-server", "author": "typicode" }
  ##>   ],
  ##>   "comments": [
  ##>     { "id": 1, "body": "some comment", "postId": 1 }
  ##>   ],
  ##>   "profile": { "name": "typicode" }
  ##> }
json-server --watch ex/db.json
curl http://localhost:3000/posts/1
  ## {
  ##   "id": 1,
  ##   "title": "json-server",
  ##   "author": "typicode"
  ## }