|
1 | | -# JSON Server [](https://travis-ci.org/typicode/json-server) [](http://badge.fury.io/js/json-server) [](https://gitter.im/typicode/json-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
| 1 | +# JSON Server [](https://travis-ci.org/typicode/json-server) [](http://badge.fury.io/js/json-server) |
2 | 2 |
|
3 | 3 | > Get a full fake REST API with __zero coding__ in __less than 30 seconds__ (seriously) |
4 | 4 |
|
@@ -33,11 +33,11 @@ Now if you go to [http://localhost:3000/posts/1](), you'll get |
33 | 33 | { "id": 1, "title": "json-server", "author": "typicode" } |
34 | 34 | ``` |
35 | 35 |
|
36 | | -Also, if you make POST, PUT, PATCH or DELETE requests, changes will be automatically saved to `db.json` using [lowdb](https://github.com/typicode/lowdb) |
| 36 | +Also, if you make POST, PUT, PATCH or DELETE requests, changes will be saved to `db.json` |
37 | 37 |
|
38 | 38 | ## Routes |
39 | 39 |
|
40 | | -Here are all the available routes. |
| 40 | +Based on the previous `db.json`, here are all the available routes. |
41 | 41 |
|
42 | 42 | ``` |
43 | 43 | GET /posts |
@@ -113,11 +113,11 @@ $ json-server http://jsonplaceholder.typicode.com/db |
113 | 113 | You can use JS to programmatically create data: |
114 | 114 |
|
115 | 115 | ```javascript |
116 | | -module.exports = function () { |
| 116 | +module.exports = function() { |
117 | 117 | data = { users: [] } |
118 | 118 | // Create 1000 users |
119 | 119 | for (var i = 0; i < 1000; i++) { |
120 | | - data.users.push({ id: i, name: 'user' + i }) |
| 120 | + data.users.push({ name: 'user' + i }) |
121 | 121 | } |
122 | 122 | return data |
123 | 123 | } |
@@ -149,13 +149,13 @@ You can deploy JSON Server. For example, [JSONPlaceholder](http://jsonplaceholde |
149 | 149 |
|
150 | 150 | ## Links |
151 | 151 |
|
152 | | -### Video tutorial |
| 152 | +### Video |
153 | 153 |
|
154 | 154 | * [Creating Demo APIs with json-server on egghead.io](https://egghead.io/lessons/nodejs-creating-demo-apis-with-json-server) |
155 | 155 |
|
156 | 156 | ### Articles |
157 | 157 |
|
158 | | -* [Fast prototyping using Restangular and Json-server](http://glebbahmutov.com/blog/fast-prototyping-using-restangular-and-json-server/) |
| 158 | +* [Fast prototyping using Restangular and Json-server](http://glebbahmutov.com/blog/fast-prototyping-restangular-and-json-server/) |
159 | 159 | * [ng-admin: Add an AngularJS admin GUI to any RESTful API](http://marmelab.com/blog/2014/09/15/easy-backend-for-your-restful-api.html) |
160 | 160 | * [how to build quick json REST APIs for development](http://outloudthinking.me/how-to-build-quick-json-rest-apis/) |
161 | 161 |
|
|
0 commit comments