- Add
--foreignKeySuffix option (e.g. snake case post_id) #556 #570
- Multiple fields sorting
GET /posts?_sort=user,views&_order=desc,asc
- Drop Node
v0.12 support
- Prevent
TypeError when a filter is applied on a null value #510
- Update index page
- Improve performances (lowdb
v0.15)
- Add
Location header to newly created resources #473
- Display custom routes on homepage
- Fix duplicate query params error #352
- Improve rewriter #431
- Improve watch mode #427
- Fix #396 PUT/PATCH saves the updated item with an id that has been converted to string
- Fix #221
nohup support
- Fix #420 TypeError when watching
db.json
- Shorter
uuid
- No automatic conversion of strings to boolean or integer
- Create a default
db.json file if it doesn't exist
- Fix
- Updated dependencies and codebase to ES6
- Fix
Links header issue when using _page
- Add query params support to the route rewriter
- Fix bodyParser issue when using custom routes
- Fix #355
- Add
_page support
- Add CLI option
--middlewares and support them in json-server.json config file
- 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