mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
20 lines
571 B
JavaScript
20 lines
571 B
JavaScript
var Gun = require('../');
|
|
var gun = Gun({
|
|
file: 'data.json',
|
|
s3: {
|
|
key: '', // AWS Access Key
|
|
secret: '', // AWS Secret Token
|
|
bucket: '' // The bucket you want to save into
|
|
}
|
|
});
|
|
gun.put({ hello: 'world' }).key('my/first/data');
|
|
|
|
var http = require('http');
|
|
http.createServer(function(req, res){
|
|
gun.get('my/first/data', function(err, 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/');
|