json-server
Advanced tools
Comparing version 0.6.4 to 0.6.5
@@ -23,2 +23,8 @@ #!/usr/bin/env node | ||
} | ||
// Disable for the moment... | ||
// host: { | ||
// alias: 'H', | ||
// description: 'Set host', | ||
// default: 'localhost' | ||
// } | ||
}) | ||
@@ -34,7 +40,7 @@ .example('$0 db.json', '') | ||
for (var prop in object) { | ||
console.log(chalk.grey(' http://localhost:' + port + '/') + chalk.cyan(prop)) | ||
console.log(chalk.grey(' http://' + host + ':' + port + '/') + chalk.cyan(prop)) | ||
} | ||
console.log( | ||
'\nYou can now go to ' + chalk.grey('http://localhost:' + port + '/\n') | ||
'\nYou can now go to ' + chalk.grey('http://' + host + ':' + port + '/\n') | ||
) | ||
@@ -70,2 +76,3 @@ | ||
var port = process.env.PORT || argv.port | ||
var host = 'localhost' //process.env.HOST || argv.host | ||
@@ -93,2 +100,2 @@ // Say hi, load file and start server | ||
}) | ||
} | ||
} |
{ | ||
"name": "json-server", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "Serves JSON files through REST routes.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -155,5 +155,8 @@ # JSON Server [![Build Status](https://travis-ci.org/typicode/json-server.svg)](https://travis-ci.org/typicode/json-server) [![NPM version](https://badge.fury.io/js/json-server.svg)](http://badge.fury.io/js/json-server) | ||
### Video | ||
* [Creating Demo APIs with json-server on egghead.io](https://egghead.io/lessons/nodejs-creating-demo-apis-with-json-server) | ||
### Articles | ||
* [Creating Demo APIs with json-server on egghead.io](https://egghead.io/lessons/nodejs-creating-demo-apis-with-json-server) | ||
* [Fast prototyping using Restangular and Json-server](http://glebbahmutov.com/blog/fast-prototyping-restangular-and-json-server/) | ||
@@ -160,0 +163,0 @@ * [ng-admin: Add an AngularJS admin GUI to any RESTful API](http://marmelab.com/blog/2014/09/15/easy-backend-for-your-restful-api.html) |
@@ -12,7 +12,8 @@ var fs = require('fs') | ||
// Don't use logger if json-server is mounted | ||
if (!module.parent) { | ||
server.use(logger('dev')) | ||
} | ||
// Logger | ||
server.use(logger('dev', { | ||
skip: function(req, res) { return req.path === '/favicon.ico' } | ||
})) | ||
// Beautify JSON | ||
server.set('json spaces', 2) | ||
@@ -19,0 +20,0 @@ |
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
28439
645
174