json-server
Advanced tools
Comparing version 0.6.5 to 0.6.6
@@ -22,9 +22,8 @@ #!/usr/bin/env node | ||
default: 3000 | ||
}, | ||
host: { | ||
alias: 'H', | ||
description: 'Set host', | ||
default: '0.0.0.0' | ||
} | ||
// Disable for the moment... | ||
// host: { | ||
// alias: 'H', | ||
// description: 'Set host', | ||
// default: 'localhost' | ||
// } | ||
}) | ||
@@ -39,8 +38,11 @@ .example('$0 db.json', '') | ||
function start(object, filename) { | ||
var port = process.env.PORT || argv.port | ||
var hostname = argv.host === '0.0.0.0' ? 'localhost' : argv.host | ||
for (var prop in object) { | ||
console.log(chalk.grey(' http://' + host + ':' + port + '/') + chalk.cyan(prop)) | ||
console.log(chalk.grey(' http://' + hostname + ':' + port + '/') + chalk.cyan(prop)) | ||
} | ||
console.log( | ||
'\nYou can now go to ' + chalk.grey('http://' + host + ':' + port + '/\n') | ||
'\nYou can now go to ' + chalk.grey('http://' + hostname + ':' + port + '/\n') | ||
) | ||
@@ -70,3 +72,3 @@ | ||
server.use(router) | ||
server.listen(port) | ||
server.listen(port, argv.host) | ||
} | ||
@@ -76,4 +78,2 @@ | ||
var source = argv._[0] | ||
var port = process.env.PORT || argv.port | ||
var host = 'localhost' //process.env.HOST || argv.host | ||
@@ -80,0 +80,0 @@ // Say hi, load file and start server |
{ | ||
"name": "json-server", | ||
"version": "0.6.5", | ||
"version": "0.6.6", | ||
"description": "Serves JSON files through REST routes.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28424
644