Skip to content

Instantly share code, notes, and snippets.

@justinwalz
Created November 23, 2015 20:12
Show Gist options
  • Save justinwalz/b206cbb3c948bca0a8e1 to your computer and use it in GitHub Desktop.
Save justinwalz/b206cbb3c948bca0a8e1 to your computer and use it in GitHub Desktop.
{
"name": "bitium-idp-web",
"version": "1.0.0",
"description": "Host levelweb",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"level": "",
"levelup": "",
"levelweb": ""
}
}
var http = require('http');
var levelweb = require('levelweb');
var levelup = require('levelup')
var db = levelup('./mydb')
var opts = { prefix: '/' };
var level = levelweb(db, opts);
http.createServer(function(req, res) {
level(req, res);
}).listen(9990);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment