aboutsummaryrefslogtreecommitdiffhomepage
path: root/app.js
diff options
context:
space:
mode:
authorGirish Ramakrishnan <girish@forwardbias.in>2015-11-27 16:36:57 -0800
committerGirish Ramakrishnan <girish@forwardbias.in>2015-11-27 16:36:57 -0800
commit5c6f8c0a837a09bc876c9705c0941888cdf3a4f6 (patch)
tree396346976787f5047eafae9554a2f5c1cad7aaeb /app.js
parentd3ceae29b655aad46c3f05d9052779d3b7694c68 (diff)
downloadSurfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.tar.gz
Surfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.tar.zst
Surfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.zip
use APP_ORIGIN instead of HOSTNAME
Diffstat (limited to 'app.js')
-rwxr-xr-xapp.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app.js b/app.js
index b1f2675..4570b07 100755
--- a/app.js
+++ b/app.js
@@ -29,7 +29,7 @@ router.put ('/api/files/*', auth.ldap, multipart, files.put);
29router.delete('/api/files/*', auth.ldap, files.del); 29router.delete('/api/files/*', auth.ldap, files.del);
30 30
31// welcome screen in case / does not serve up any file yet 31// welcome screen in case / does not serve up any file yet
32var appUrl = process.env.HOSTNAME ? 'https://' + process.env.HOSTNAME : 'http://localhost:3000'; 32var appUrl = process.env.APP_ORIGIN ? process.env.APP_ORIGIN : 'http://localhost:3000';
33router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); }); 33router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); });
34 34
35app.use(morgan('dev')); 35app.use(morgan('dev'));
@@ -54,4 +54,4 @@ var server = app.listen(3000, function () {
54 54
55 console.log('Surfer listening at http://%s:%s', host, port); 55 console.log('Surfer listening at http://%s:%s', host, port);
56 console.log('Using base path', basePath); 56 console.log('Using base path', basePath);
57}); \ No newline at end of file 57});