Created
March 1, 2016 14:52
-
-
Save kristian76/4aa7a907c788a8b0fa69 to your computer and use it in GitHub Desktop.
Gun DB and node.js
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
/* | |
* Package.json | |
*/ | |
{ | |
"name": "gunner", | |
"version": "1.0.0", | |
"description": "", | |
"main": "http.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "node http.js" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"express": "^4.13.4", | |
"gun": "^0.3.7" | |
} | |
} | |
/** | |
* http.js | |
*/ | |
var express = require('express'), | |
app = express(); | |
var Gun = require('gun'); | |
var gun = Gun({ | |
file: 'data.json' | |
}); | |
gun.wsp(app); | |
app.use(express.static(__dirname)).listen(9000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment