mirror of
https://github.com/typicode/json-server.git
synced 2025-07-31 22:25:05 +08:00
Update README.md
This commit is contained in:
@ -34,11 +34,11 @@ $ curl -i http://localhost:3000/posts/1
|
|||||||
```javascript
|
```javascript
|
||||||
var server = require('json-server');
|
var server = require('json-server');
|
||||||
|
|
||||||
server.setDB({
|
server.low.db = {
|
||||||
posts: [
|
posts: [
|
||||||
{ id: 1, body: 'foo' }
|
{ id: 1, body: 'foo' }
|
||||||
]
|
]
|
||||||
});
|
}
|
||||||
|
|
||||||
server.get('/another/route', function(req, res, next) {
|
server.get('/another/route', function(req, res, next) {
|
||||||
// ...
|
// ...
|
||||||
|
Reference in New Issue
Block a user