mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
22 lines
542 B
JavaScript
22 lines
542 B
JavaScript
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({
|
|
file: 'data.json',
|
|
s3: {
|
|
key: '', // AWS Access Key
|
|
secret: '', // AWS Secret Token
|
|
bucket: '' // The bucket you want to save into
|
|
}
|
|
});
|
|
|
|
var server = http.createServer(function(req, res){
|
|
gun.server(req, res);
|
|
});
|
|
gun.attach(server);
|
|
server.listen(port);
|
|
|
|
console.log('Server started on port ' + port + ' with /gun');
|