Socket
Socket
Sign inDemoInstall

json-server

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-server - npm Package Compare versions

Comparing version 0.6.5 to 0.6.6

22

bin/index.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc