Commit 5c6f8c0a by Girish Ramakrishnan

use APP_ORIGIN instead of HOSTNAME

1 parent d3ceae29
Showing with 2 additions and 3 deletions
...@@ -29,7 +29,7 @@ router.put ('/api/files/*', auth.ldap, multipart, files.put); ...@@ -29,7 +29,7 @@ router.put ('/api/files/*', auth.ldap, multipart, files.put);
router.delete('/api/files/*', auth.ldap, files.del); router.delete('/api/files/*', auth.ldap, files.del);
// welcome screen in case / does not serve up any file yet // welcome screen in case / does not serve up any file yet
var appUrl = process.env.HOSTNAME ? 'https://' + process.env.HOSTNAME : 'http://localhost:3000'; var appUrl = process.env.APP_ORIGIN ? process.env.APP_ORIGIN : 'http://localhost:3000';
router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); }); router.get('/', function (req, res) { res.status(200).send(ejs.render(fs.readFileSync(path.join(__dirname, '/app/welcome.html'), 'utf8'), { appUrl: appUrl })); });
app.use(morgan('dev')); app.use(morgan('dev'));
...@@ -54,4 +54,4 @@ var server = app.listen(3000, function () { ...@@ -54,4 +54,4 @@ var server = app.listen(3000, function () {
console.log('Surfer listening at http://%s:%s', host, port); console.log('Surfer listening at http://%s:%s', host, port);
console.log('Using base path', basePath); console.log('Using base path', basePath);
}); });
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!