summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2017-10-21 18:17:19 +0300
committerYuval Adam <_@yuv.al>2017-10-21 18:17:19 +0300
commitba99d479918fa7408d04ab18015554994a95f486 (patch)
tree23375b456affbbc5cffb3ceaf0ba4e9542a4b3a3 /server.js
parent535389cd00f66b6d7c2087c4c42b0021a90a80f1 (diff)
Transition from Python to JS stack
Diffstat (limited to 'server.js')
-rw-r--r--server.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/server.js b/server.js
index e612391..5ae4c22 100644
--- a/server.js
+++ b/server.js
@@ -70,9 +70,11 @@ function fetchImages() {
})
}
+app.set('port', (process.env.PORT || 3000));
app.set('view engine', 'pug')
+app.set('views', __dirname + '/views');
-app.use('/static', express.static('static'))
+app.use('/static', express.static(__dirname + 'static'))
app.use('/', function (req, res, next){
res.on('finish', function(){
@@ -122,6 +124,6 @@ app.get('/', function (req, res) {
res.render('index', { prod: process.env.NODE_ENV === 'production' })
})
-app.listen(3000, function () {
- console.log('Starting geshem.space server')
+app.listen(app.get('port'), function () {
+ console.log('Starting geshem.space server on port', app.get('port'))
})