diff options
author | Girish Ramakrishnan <girish@forwardbias.in> | 2015-11-27 16:36:57 -0800 |
---|---|---|
committer | Girish Ramakrishnan <girish@forwardbias.in> | 2015-11-27 16:36:57 -0800 |
commit | 5c6f8c0a837a09bc876c9705c0941888cdf3a4f6 (patch) | |
tree | 396346976787f5047eafae9554a2f5c1cad7aaeb | |
parent | d3ceae29b655aad46c3f05d9052779d3b7694c68 (diff) | |
download | Surfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.tar.gz Surfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.tar.zst Surfer-5c6f8c0a837a09bc876c9705c0941888cdf3a4f6.zip |
use APP_ORIGIN instead of HOSTNAME
-rwxr-xr-x | app.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -29,7 +29,7 @@ router.put ('/api/files/*', auth.ldap, multipart, files.put); | |||
29 | router.delete('/api/files/*', auth.ldap, files.del); | 29 | router.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 |
32 | var appUrl = process.env.HOSTNAME ? 'https://' + process.env.HOSTNAME : 'http://localhost:3000'; | 32 | var appUrl = process.env.APP_ORIGIN ? process.env.APP_ORIGIN : 'http://localhost:3000'; |
33 | router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); }); | 33 | router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); }); |
34 | 34 | ||
35 | app.use(morgan('dev')); | 35 | app.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 | }); |