Browse Source

by dflt multiserver listen only to localhost

activeAddress
Matias Alejo Garcia 10 years ago
parent
commit
520d20de31
  1. 5
      multilevel/start.js

5
multilevel/start.js

@ -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);

Loading…
Cancel
Save