- Add CLI option
--middlewares
- Fix snapshot creation for JS files (ex:
json-server generator.js)
- Support
x-www-form-urlencoded
- Bug fix:
--watch option on OS X
- Bug fix: data wasn't written to file in
v0.8.13 and v0.8.12
- Make
_like operator case insensitive
- Support sort by nested field (e.g.
_sort=author.name)
- Fix
graceful-fs warning
- CLI option
-ng/--no-gzip to disable gzip compression
- CLI can now read options from
json-server.json if present
- CLI option
-c/--config to point to a different configuration file
gzip compression to improve performances
- CLI option
-nc/--no-cors to disable CORS
- CLI option
-ro/--read-only to allow only GET requests
- Like operator
GET /posts?title_like=json (accepts RegExp)
- CLI option
-q/--quiet
- Nested route
POST /posts/1/comments
- Not equal operator
GET /posts?id_ne=1
- CLI option
-S/--snapshots to set a custom snapshots directory.
- Fix plural resources:
DELETE should return 404 if resource doesn't exist.
- Fix plural resources:
PUT should replace resource instead of updating properties.
- Fix singular resources:
POST, PUT, PATCH should not convert resource properties.
jsonServer.defaults is now a function and can take an object.
If you're using the project as a module, you need to update your code:
// Before
jsonServer.defaults
// After
jsonServer.defaults()
jsonServer.defaults({ static: '/some/path'})
- Automatically ignore unknown query parameters.
# Before
GET /posts?author=typicode&foo=bar # []
# After
GET /posts?author=typicode&foo=bar # [{...}, {...}]
- CLI option for setting a custom static files directory.
json-server --static some/path
# Support range
GET /products?price_gte=50&price_lte=100
# Support OR
GET /posts?id=1&id2
GET /posts?category=javascript&category=html
# Support embed and expand in lists
GET /posts?embed=comments
GET /posts?expand=user