From 5c6f8c0a837a09bc876c9705c0941888cdf3a4f6 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 27 Nov 2015 16:36:57 -0800 Subject: [PATCH] use APP_ORIGIN instead of HOSTNAME --- app.js | 4 ++-- 1 file 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); router.delete('/api/files/*', auth.ldap, files.del); // 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 })); }); app.use(morgan('dev')); @@ -54,4 +54,4 @@ var server = app.listen(3000, function () { console.log('Surfer listening at http://%s:%s', host, port); console.log('Using base path', basePath); -}); \ No newline at end of file +}); -- 2.41.0