Created
November 23, 2015 20:12
-
-
Save justinwalz/b206cbb3c948bca0a8e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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": "" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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