]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
use APP_ORIGIN instead of HOSTNAME
authorGirish Ramakrishnan <girish@forwardbias.in>
Sat, 28 Nov 2015 00:36:57 +0000 (16:36 -0800)
committerGirish Ramakrishnan <girish@forwardbias.in>
Sat, 28 Nov 2015 00:36:57 +0000 (16:36 -0800)
app.js

diff --git a/app.js b/app.js
index b1f26750a43b0e2925880a6ac9fd75971d6b6833..4570b07a4e92bfbd8d33ead26c45cc6de3e0240e 100755 (executable)
--- 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
+});