@@ -252,6 +252,41 @@ Now you can access resources using additional routes.
252252/blog/posts/1/show
253253```
254254
255+ ### CLI usage
256+
257+ ```
258+ json-server [options] <source>
259+
260+ Options:
261+ --config, -c Path to config file [default: "json-server.json"]
262+ --port, -p Set port [default: 3000]
263+ --host, -H Set host [default: "0.0.0.0"]
264+ --watch, -w Watch file(s) [boolean]
265+ --routes, -r Path to routes file
266+ --static, -s Set static files directory
267+ --read-only, --ro Allow only GET requests [boolean]
268+ --no-cors, --nc Disable Cross-Origin Resource Sharing [boolean]
269+ --snapshots, -S Set snapshots directory [default: "."]
270+ --delay, -d Add delay to responses (ms)
271+ --id, -i Set database id property (e.g. _id) [default: "id"]
272+ --quiet, -q Suppress log messages from output [boolean]
273+ --help, -h Show help [boolean]
274+ --version, -v Show version number [boolean]
275+
276+ Examples:
277+ bin db.json
278+ bin file.js
279+ bin http://example.com/db.json
280+ ```
281+
282+ You can also set options in a ` json-server.json ` configuration file.
283+
284+ ``` json
285+ {
286+ "port" : 3000
287+ }
288+ ```
289+
255290### Module
256291
257292If you need to add authentication, validation, you can use the project as a module in combination with other Express middlewares.
0 commit comments