diff --git a/.travis.yml b/.travis.yml index 7ef2762c..a5540c04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ -language: node_js -node_js: - - 0.6 - - 0.8 - - 0.10 +language: node_js +node_js: + - 0.6 + - 0.8 + - 0.10 - 0.11 \ No newline at end of file diff --git a/README.md b/README.md index 5e8787de..15d40afd 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,65 @@ -gun [](https://travis-ci.org/amark/gun) -=== - -Quick getting started guide. - -Make sure you already have node and npm installed. - -`npm install gun` - -Then require it in your app. - -`var Gun = require('gun');` - -Then initialize a gun instance with your AWS S3 credentials. - -```JavaScript -var gun = Gun({ - s3: { - key: '', // AWS Access Key - secret: '', // AWS Secret Token - bucket: '' // The bucket you want to save into -}}); -``` - -S3 is the default persistence layer, it can be replaced with others. - -Currently, gun is only key/value but graph support is coming soon. - -Save your first object, and create a reference to it. - -`gun.set({ hello: 'world' }).key('my/first/data');` - -Now, altogether, with the node hello world web server that replies with your data. - -```JavaScript -var Gun = require('gun'); -var gun = Gun({ - s3: { - key: '', // AWS Access Key - secret: '', // AWS Secret Token - bucket: '' // The bucket you want to save into -}}); -gun.set({ hello: 'world' }).key('my/first/data'); - -var http = require('http'); -http.createServer(function (req, res) { - gun.load('my/first/data', function(data){ - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end(JSON.stringify(data)); - }); -}).listen(1337, '127.0.0.1'); -console.log('Server running at http://127.0.0.1:1337/'); -``` - -Now fire up your browser and hit that URL - you'll see your data, plus some gun specific metadata. - -## Ahead -- Realtime push to the browser -- Persistence in the browser -- Authorization callbacks -- Graph manipulation -- Server to server communication -- Test more -- Bug fixes -- More via additional module hooks (schema, queries, etc.) +gun [](https://travis-ci.org/amark/gun) +=== + +Quick getting started guide. + +Make sure you already have node and npm installed. + +`npm install gun` + +Then require it in your app. + +`var Gun = require('gun');` + +Then initialize a gun instance with your AWS S3 credentials. + +```JavaScript +var gun = Gun({ + s3: { + key: '', // AWS Access Key + secret: '', // AWS Secret Token + bucket: '' // The bucket you want to save into +}}); +``` + +S3 is the default persistence layer, it can be replaced with others. + +Currently, gun is only key/value but graph support is coming soon. + +Save your first object, and create a reference to it. + +`gun.set({ hello: 'world' }).key('my/first/data');` + +Now, altogether, with the node hello world web server that replies with your data. + +```JavaScript +var Gun = require('gun'); +var gun = Gun({ + s3: { + key: '', // AWS Access Key + secret: '', // AWS Secret Token + bucket: '' // The bucket you want to save into +}}); +gun.set({ hello: 'world' }).key('my/first/data'); + +var http = require('http'); +http.createServer(function (req, res) { + gun.load('my/first/data', function(data){ + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end(JSON.stringify(data)); + }); +}).listen(1337, '127.0.0.1'); +console.log('Server running at http://127.0.0.1:1337/'); +``` + +Now fire up your browser and hit that URL - you'll see your data, plus some gun specific metadata. + +## Ahead +- Realtime push to the browser +- Persistence in the browser +- Authorization callbacks +- Graph manipulation +- Server to server communication +- Test more +- Bug fixes +- More via additional module hooks (schema, queries, etc.) diff --git a/examples/admin/app.js b/examples/admin/app.js index 169d7eb7..50c73321 100644 --- a/examples/admin/app.js +++ b/examples/admin/app.js @@ -1,25 +1,26 @@ -console.log("If modules not found, run `npm install` in example/admin folder!"); - -var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || 8888; -var express = require('express'); -var bodyParser = require('body-parser'); -var app = express(); -var Gun = require('gun'); -var gun = Gun({ - peers: 'http://localhost:' + port + '/gun' - ,s3: require('../../test/shotgun') // replace this with your own keys! -}); - -app.use(express.static(__dirname)) - .use(bodyParser.json()) - .use(gun.server); -app.listen(port); - -console.log('Express started on port ' + port + ' with /gun'); - -gun.load('blob/data', function(){ // ugh need to initialize the data if there is none, what a waste of LOC! - gun.set({_:{'#': "yVbyf7BqlXVQQUOE5cw9rf8h",'>':{hello: 1407328713707,from: 1407328713707}}, // this is a nasty trick to force the ID to overwrite itself - hello: "world", - from: "Mark Nadal" - }).key('blob/data'); +console.log("HEY YOU"); +console.log("If modules not found, run `npm install` in example/admin folder!"); + +var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || 8888; +var express = require('express'); +var bodyParser = require('body-parser'); +var app = express(); +var Gun = require('gun'); +var gun = Gun({ + peers: 'http://localhost:' + port + '/gun' + ,s3: require('../../test/shotgun') // replace this with your own keys! +}); + +app.use(express.static(__dirname)) + .use(bodyParser.json()) + .use(gun.server); +app.listen(port); + +console.log('Express started on port ' + port + ' with /gun'); + +gun.load('blob/data', function(){ // ugh need to initialize the data if there is none, what a waste of LOC! + gun.set({_:{'#': "yVbyf7BqlXVQQUOE5cw9rf8h",'>':{hello: 1407328713707,from: 1407328713707}}, // this is a nasty trick to force the ID to overwrite itself + hello: "world", + from: "Mark Nadal" + }).key('blob/data'); }); \ No newline at end of file diff --git a/examples/admin/package.json b/examples/admin/package.json index 4cd8d27b..4b56387c 100644 --- a/examples/admin/package.json +++ b/examples/admin/package.json @@ -1,9 +1,9 @@ -{ - "name": "admin", - "main": "app.js", - "dependencies": { - "express": "~>4.9.0", - "body-parser": "~>1.8.1", - "gun": "~>0.0.2b" - } +{ + "name": "admin", + "main": "app.js", + "dependencies": { + "express": "~>4.9.0", + "body-parser": "~>1.8.1", + "gun": "~>0.0.2b" + } } \ No newline at end of file diff --git a/gate/s3pricing.html b/gate/s3pricing.html index cf13f4fb..3f8bb98e 100644 --- a/gate/s3pricing.html +++ b/gate/s3pricing.html @@ -1,64 +1,64 @@ - - -
- - - - - -- This page is for throughput calculation, it assumes continuous load non-stop. -
- - + + + + + + + + ++ This page is for throughput calculation, it assumes continuous load non-stop. +
+ + \ No newline at end of file diff --git a/hello-world.js b/hello-world.js index 323d2861..fd558d70 100644 --- a/hello-world.js +++ b/hello-world.js @@ -1,17 +1,17 @@ -var Gun = require('gun'); -var gun = Gun({ - s3: { - key: '', // AWS Access Key - secret: '', // AWS Secret Token - bucket: '' // The bucket you want to save into -}}); -gun.set({ hello: 'world' }).key('my/first/data') - -var http = require('http'); -http.createServer(function (req, res) { - gun.load('my/first/data', function(data){ - res.writeHead(200, {'Content-Type': 'application/json'}); - res.end(JSON.stringify(data)); - }); -}).listen(1337, '127.0.0.1'); +var Gun = require('gun'); +var gun = Gun({ + s3: { + key: '', // AWS Access Key + secret: '', // AWS Secret Token + bucket: '' // The bucket you want to save into +}}); +gun.set({ hello: 'world' }).key('my/first/data') + +var http = require('http'); +http.createServer(function (req, res) { + gun.load('my/first/data', function(data){ + res.writeHead(200, {'Content-Type': 'application/json'}); + res.end(JSON.stringify(data)); + }); +}).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); \ No newline at end of file diff --git a/web/deck/index.html b/web/deck/index.html index 8c636561..30a180b1 100644 --- a/web/deck/index.html +++ b/web/deck/index.html @@ -5,12 +5,12 @@