Merge pull request #172 from matiu/feat/local-bind
by dflt multiserver listen only to localhost
This commit is contained in:
commit
aec2f341d5
|
@ -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);
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue