Get a full fake REST API with zero coding in less than 30 seconds (seriously)
- NodeJS: https://nodejs.org/en/
- IDE/Code Editor: VS Code: https://code.visualstudio.com/
npm install -g json-server
$ node -v
- ⇧⌥F
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
-
cd db.json dir
json-server --watch db.json
- http://localhost:3000/posts/1, you'll get
{ "id": 1, "title": "json-server", "author": "typicode" }