From 50faba6a56cf5d24b2c3cac28e1812f8c9cad938 Mon Sep 17 00:00:00 2001 From: typicode Date: Fri, 8 May 2015 17:21:36 +0200 Subject: [PATCH] Update README.md --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c9b2f4f..25ac2e8 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ -# JSON Server [![](https://travis-ci.org/typicode/json-server.svg)](https://travis-ci.org/typicode/json-server) [![](https://badge.fury.io/js/json-server.svg)](http://badge.fury.io/js/json-server) +# JSON Server [![](https://travis-ci.org/typicode/json-server.svg)](https://travis-ci.org/typicode/json-server) [![](https://badge.fury.io/js/json-server.svg)](http://badge.fury.io/js/json-server) [![Join the chat at https://gitter.im/typicode/json-server](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/typicode/json-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) > Get a full fake REST API with __zero coding__ in __less than 30 seconds__ (seriously) Created with <3 for front-end developers who need a quick back-end for prototyping and mocking. -Links: * [JSONPlaceholder - Live running version](http://jsonplaceholder.typicode.com) * [Online video tutorial - Creating demo APIs with json-server](https://egghead.io/lessons/nodejs-creating-demo-apis-with-json-server) - - ## Example Create a `db.json` file @@ -37,7 +34,7 @@ Now if you go to [http://localhost:3000/posts/1](), you'll get { "id": 1, "title": "json-server", "author": "typicode" } ``` -Also, if you make POST, PUT, PATCH or DELETE requests, changes will be saved to `db.json` +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) ## Routes @@ -121,7 +118,7 @@ module.exports = function() { data = { users: [] } // Create 1000 users for (var i = 0; i < 1000; i++) { - data.users.push({ name: 'user' + i }) + data.users.push({ id: i, name: 'user' + i }) } return data } @@ -159,7 +156,7 @@ You can deploy JSON Server. For example, [JSONPlaceholder](http://jsonplaceholde ### Articles -* [Fast prototyping using Restangular and Json-server](http://glebbahmutov.com/blog/fast-prototyping-restangular-and-json-server/) +* [Fast prototyping using Restangular and Json-server](http://glebbahmutov.com/blog/fast-prototyping-using-restangular-and-json-server/) * [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) * [how to build quick json REST APIs for development](http://outloudthinking.me/how-to-build-quick-json-rest-apis/)