2015-04-06 08:56:36 -07:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2015-04-05 11:42:56 -07:00
|
|
|
var multilevel = require('multilevel');
|
|
|
|
var net = require('net');
|
|
|
|
var level = require('levelup');
|
|
|
|
|
|
|
|
var db = level('./db', {
|
|
|
|
valueEncoding: 'json'
|
|
|
|
});
|
2015-04-06 08:56:36 -07:00
|
|
|
var HOST = 'localhost';
|
2015-04-15 06:35:37 -07:00
|
|
|
var PORT = 3230;
|
2015-04-05 11:42:56 -07:00
|
|
|
|
|
|
|
|
|
|
|
console.log('Server started at port ' + PORT + '...');
|
|
|
|
net.createServer(function(con) {
|
|
|
|
con.pipe(multilevel.server(db)).pipe(con);
|
2015-04-06 08:56:36 -07:00
|
|
|
}).listen(PORT, HOST);
|