mirror of
https://github.com/typicode/json-server.git
synced 2025-07-30 13:42:11 +08:00
Add switch for GZIP Content-Encoding
This commit is contained in:
@ -41,6 +41,10 @@ module.exports = function () {
|
||||
alias: 'nc',
|
||||
description: 'Disable Cross-Origin Resource Sharing'
|
||||
},
|
||||
'no-gzip': {
|
||||
alias: 'ng',
|
||||
description: 'Disable GZIP Content-Encoding'
|
||||
},
|
||||
snapshots: {
|
||||
alias: 'S',
|
||||
description: 'Set snapshots directory',
|
||||
@ -69,6 +73,7 @@ module.exports = function () {
|
||||
.boolean('read-only')
|
||||
.boolean('quiet')
|
||||
.boolean('no-cors')
|
||||
.boolean('no-gzip')
|
||||
.help('help').alias('help', 'h')
|
||||
.version(pkg.version).alias('version', 'v')
|
||||
.example('$0 db.json', '')
|
||||
|
@ -45,7 +45,8 @@ function createApp (source, object, routes, argv) {
|
||||
var defaultsOpts = {
|
||||
logger: !argv.quiet,
|
||||
readOnly: argv.readOnly,
|
||||
noCors: argv.noCors
|
||||
noCors: argv.noCors,
|
||||
noGzip: argv.noGzip
|
||||
}
|
||||
|
||||
if (argv.static) {
|
||||
|
Reference in New Issue
Block a user