From 3e7df721cbb01d72e42bb6d3d12de3db3fcbef34 Mon Sep 17 00:00:00 2001 From: Jesse Gibson Date: Mon, 8 Aug 2016 17:38:13 -0600 Subject: [PATCH] Change default port to 8080 Since it's made as an example app, might as well make it easy to get started. Port 80 throws an error if the server hasn't been started as sudo, requiring port 8080 to be explicitly passed if you want to run the demo locally. --- examples/http.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/http.js b/examples/http.js index 3a9811ad..bca6a305 100644 --- a/examples/http.js +++ b/examples/http.js @@ -2,11 +2,11 @@ var path = require('path'); var http = require('http'); var fs = require('fs'); -var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 80; +var port = process.env.OPENSHIFT_NODEJS_PORT || process.env.VCAP_APP_PORT || process.env.PORT || process.argv[2] || 8080; var ip = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'; var Gun = require('gun'); -var gun = Gun({ +var gun = Gun({ file: 'data.json', s3: { key: '', // AWS Access Key @@ -16,7 +16,7 @@ var gun = Gun({ }); var server = http.createServer(function(req, res){ - if(gun.wsp.server(req, res)){ + if(gun.wsp.server(req, res)){ return; // filters gun requests! } fs.createReadStream(path.join(__dirname, req.url)).on('error',function(){ // static files! @@ -27,4 +27,4 @@ var server = http.createServer(function(req, res){ gun.wsp(server); server.listen(port, ip); -console.log('Server started on port ' + port + ' with /gun'); \ No newline at end of file +console.log('Server started on port', port, 'with /gun');