Skip to content

Instantly share code, notes, and snippets.

@kristian76
Created March 1, 2016 14:52
Show Gist options
  • Save kristian76/4aa7a907c788a8b0fa69 to your computer and use it in GitHub Desktop.
Save kristian76/4aa7a907c788a8b0fa69 to your computer and use it in GitHub Desktop.
Gun DB and node.js
/*
* 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