Merge pull request #172 from matiu/feat/local-bind

by dflt multiserver listen only to localhost
This commit is contained in:
Ivan Socolsky 2015-04-06 16:25:56 -03:00
commit aec2f341d5
3 changed files with 5 additions and 2 deletions

View File

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
var multilevel = require('multilevel');
var net = require('net');
var level = require('levelup');
@ -5,10 +7,11 @@ var level = require('levelup');
var db = level('./db', {
valueEncoding: 'json'
});
var HOST = 'localhost';
var PORT = 3002;
console.log('Server started at port ' + PORT + '...');
net.createServer(function(con) {
con.pipe(multilevel.server(db)).pipe(con);
}).listen(PORT);
}).listen(PORT, HOST);

View File

@ -51,7 +51,7 @@
"supertest": "*"
},
"scripts": {
"start": "node app.js",
"start": "node bws.js",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- --reporter spec test",
"test": "./node_modules/.bin/mocha",
"coveralls": "./node_modules/.bin/istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"