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