json-server
Advanced tools
Comparing version 0.8.19 to 0.8.20
# Change Log | ||
## [0.8.20][2016-09-12] | ||
* Fix [#355](https://github.com/typicode/json-server/issues/355) | ||
* Add `_page` support | ||
## [0.8.19][2016-08-18] | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "json-server", | ||
"version": "0.8.19", | ||
"version": "0.8.20", | ||
"description": "Serves JSON files through REST routes.", | ||
@@ -5,0 +5,0 @@ "main": "./src/server/index.js", |
@@ -88,12 +88,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) [![](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) | ||
### Slice | ||
### Paginate | ||
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response) | ||
Add `_page` and in the `Link` header you'll get `first`, `prev`, `next` and `last` links | ||
``` | ||
GET /posts?_start=20&_end=30 | ||
GET /posts/1/comments?_start=20&_end=30 | ||
GET /posts/1/comments?_start=20&_limit=10 | ||
GET /posts?_page=7 | ||
``` | ||
_10 items are returned by default_ | ||
### Sort | ||
@@ -108,2 +108,12 @@ | ||
### Slice | ||
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response) | ||
``` | ||
GET /posts?_start=20&_end=30 | ||
GET /posts/1/comments?_start=20&_end=30 | ||
GET /posts/1/comments?_start=20&_limit=10 | ||
``` | ||
### Operators | ||
@@ -110,0 +120,0 @@ |
@@ -171,3 +171,3 @@ var fs = require('fs') | ||
.on('change', function (file) { | ||
if (file === source) { | ||
if (path.resolve(file) === path.resolve(source)) { | ||
if (is.JSON(file)) { | ||
@@ -174,0 +174,0 @@ var obj = JSON.parse(fs.readFileSync(file)) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
82512
465