From fd702221ab894bdaec0041bbd3e3cacc6a1d0b7c Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Thu, 15 Jan 2015 12:17:50 -0700 Subject: [PATCH] Forrest's awesome module --- examples/http.js | 12 ++++++++++++ package.json | 2 +- web/forrest-notes.txt | 14 ++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 examples/http.js create mode 100644 web/forrest-notes.txt diff --git a/examples/http.js b/examples/http.js new file mode 100644 index 00000000..432358a4 --- /dev/null +++ b/examples/http.js @@ -0,0 +1,12 @@ +var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 80; + +var http = require('http'); + +var Gun = require('gun'); +var gun = Gun({ + s3: (process.env.NODE_ENV === 'production')? null : require('../test/shotgun') // replace this with your own keys! +}); + +var server = gun.attach(http.createServer(gun.server)).listen(port); + +console.log('Server started on port ' + port + ' with /gun'); diff --git a/package.json b/package.json index 11d6b5ed..4d5476a0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "gun" -, "version": "0.0.9a" +, "version": "0.0.9c" , "author": "Mark Nadal" , "description": "Graph engine." , "engines": { diff --git a/web/forrest-notes.txt b/web/forrest-notes.txt new file mode 100644 index 00000000..78d1acca --- /dev/null +++ b/web/forrest-notes.txt @@ -0,0 +1,14 @@ +NOTES FROM FORREST: + + 1 make raw HTTP work and document it, document that attach needs to be BEFORE listen. (talk to AJ) + 2 make sure you SUPPRESS your comments, Mark. + 3 .get doesn't work on subsequent closures. WHYYY?? + 4 HOW DO I DELETE? Mark: delete the actual field from the data, but not the stream/meta. + 5 security ideas: have gun KEY regexs that are whitelist/blacklist. Off the keys. + 6 Forrest says, "arrays". + 7 get VAL without gun meta-data. + 8 make it work with just Gun('/gun'); + + +gun.js +gun-bundle.js