diff --git a/server.js b/server.js index 627be7a..5f6d536 100644 --- a/server.js +++ b/server.js @@ -39,7 +39,9 @@ app.use(renderer) app.get('/', (req, res) => { res.render('index', { - baseUrl: req.protocol + '://' + req.headers.host, + baseUrl: req.hostname.startsWith('localhost') + ? req.protocol + '://' + req.headers.host + : '//' + req.hostname, // auto choose http or https }) })