diff options
| author | Yuval Adam <_@yuv.al> | 2017-10-21 18:17:19 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2017-10-21 18:17:19 +0300 |
| commit | ba99d479918fa7408d04ab18015554994a95f486 (patch) | |
| tree | 23375b456affbbc5cffb3ceaf0ba4e9542a4b3a3 /server.js | |
| parent | 535389cd00f66b6d7c2087c4c42b0021a90a80f1 (diff) | |
Transition from Python to JS stack
Diffstat (limited to 'server.js')
| -rw-r--r-- | server.js | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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')) }) |
