Skip to content

Commit 841bd7f

Browse files
committed
Add config option
1 parent ab3e611 commit 841bd7f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"server-destroy": "^1.0.1",
2727
"underscore-db": "^0.9.1",
2828
"update-notifier": "^0.5.0",
29-
"yargs": "^3.10.0"
29+
"yargs": "^4.2.0"
3030
},
3131
"devDependencies": {
3232
"husky": "^0.6.1",

src/cli/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = function () {
88
updateNotifier({ pkg: pkg }).notify()
99

1010
var argv = yargs
11+
.config('config')
1112
.usage('$0 [options] <source>')
1213
.options({
1314
port: {
@@ -26,7 +27,7 @@ module.exports = function () {
2627
},
2728
routes: {
2829
alias: 'r',
29-
description: 'Load routes file'
30+
description: 'Path to routes file'
3031
},
3132
static: {
3233
alias: 's',
@@ -57,6 +58,11 @@ module.exports = function () {
5758
quiet: {
5859
alias: 'q',
5960
description: 'Suppress log messages from output'
61+
},
62+
config: {
63+
alias: 'c',
64+
description: 'Path to config file',
65+
default: 'json-server.json'
6066
}
6167
})
6268
.boolean('watch')

0 commit comments

Comments
 (0)