You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
321 B
14 lines
321 B
var multilevel = require('multilevel');
|
|
var net = require('net');
|
|
var level = require('levelup');
|
|
|
|
var db = level('./db', {
|
|
valueEncoding: 'json'
|
|
});
|
|
var PORT = 3002;
|
|
|
|
|
|
console.log('Server started at port ' + PORT + '...');
|
|
net.createServer(function(con) {
|
|
con.pipe(multilevel.server(db)).pipe(con);
|
|
}).listen(PORT);
|
|
|