mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 04:32:24 +08:00
Add config option
This commit is contained in:
@ -26,7 +26,7 @@
|
|||||||
"server-destroy": "^1.0.1",
|
"server-destroy": "^1.0.1",
|
||||||
"underscore-db": "^0.9.1",
|
"underscore-db": "^0.9.1",
|
||||||
"update-notifier": "^0.5.0",
|
"update-notifier": "^0.5.0",
|
||||||
"yargs": "^3.10.0"
|
"yargs": "^4.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"husky": "^0.6.1",
|
"husky": "^0.6.1",
|
||||||
|
@ -8,6 +8,7 @@ module.exports = function () {
|
|||||||
updateNotifier({ pkg: pkg }).notify()
|
updateNotifier({ pkg: pkg }).notify()
|
||||||
|
|
||||||
var argv = yargs
|
var argv = yargs
|
||||||
|
.config('config')
|
||||||
.usage('$0 [options] <source>')
|
.usage('$0 [options] <source>')
|
||||||
.options({
|
.options({
|
||||||
port: {
|
port: {
|
||||||
@ -26,7 +27,7 @@ module.exports = function () {
|
|||||||
},
|
},
|
||||||
routes: {
|
routes: {
|
||||||
alias: 'r',
|
alias: 'r',
|
||||||
description: 'Load routes file'
|
description: 'Path to routes file'
|
||||||
},
|
},
|
||||||
static: {
|
static: {
|
||||||
alias: 's',
|
alias: 's',
|
||||||
@ -57,6 +58,11 @@ module.exports = function () {
|
|||||||
quiet: {
|
quiet: {
|
||||||
alias: 'q',
|
alias: 'q',
|
||||||
description: 'Suppress log messages from output'
|
description: 'Suppress log messages from output'
|
||||||
|
},
|
||||||
|
config: {
|
||||||
|
alias: 'c',
|
||||||
|
description: 'Path to config file',
|
||||||
|
default: 'json-server.json'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.boolean('watch')
|
.boolean('watch')
|
||||||
|
Reference in New Issue
Block a user