Simulate Mock REST API (JSON SERVER)

Install “json-server” from NPM 
(Ref: https://github.com/typicode/json-server)

  1. cmd (with admin)> type “npm install -g json-server”
install json-server by using npm

2. create json file (write json as object)

//db.json
{
"obj1": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"obj2": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"obj3": { "name": "typicode" }
}

3. locate that file > open cmd > run below script

$ json-server --watch db.json

4. open browser > open address http://localhost:3000

Good job! for open JSON SERVER

5. Done! You can see Resources as ‘obj1’, ‘obj2’, ‘obj3’ that we create json file .. try to check ‘obj1’

— TIPS — for clean JSON structure in chrome browser … download plug-in name ‘JSON Formatter

— NEXT RELATED

lowdb - small local JSON database powered by lodash (supports Node, the browser and Electron)
Ref: https://github.com/typicode/lowdb

Testing Apis in Angular 2 With MockBackend

Ref: http://www.thejoemorgan.com/blog/2016/11/21/testing-apis-in-angular-2/

Angular apiMock

Automatically route your API calls to static JSON files, for hiccup free front–end development.
Ref: http://johansson.jp/angular-apimock/#/demo-simple

ATMO — Server side powertool for prototyping

Ref: https://github.com/Raathigesh/Atmo