Merge pull request 'Fall back to default 2314 port if settings.json doesn't exist and process.env.PORT doesn't exist. Fixes #31.' (#32) from VirtualWolf/Fipamo:beta-release into beta-release

Reviewed-on: https://code.playvicio.us/Are0h/Fipamo/pulls/32
Reviewed-by: Are0h <ro@playvicio.us>
This commit is contained in:
Are0h 2020-08-13 21:58:47 +02:00
commit 4ad0f38a63
2 changed files with 9 additions and 5 deletions

View file

@ -21,11 +21,10 @@ block main-content
br br
label And let's confirm that password label And let's confirm that password
br br
input.large(type='password', name='new_member_pass2' id='new_member_pass2', placeholder="Email Confirm") input.large(type='password', name='new_member_pass2' id='new_member_pass2', placeholder="Password Confirm")
br br
label And finally, a title label And finally, a title
br br
input.large(type='text', name='new_member_title' id='new_member_title', placeholder="Site Title Please") input.large(type='text', name='new_member_title' id='new_member_title', placeholder="Site Title Please")
br br
button#init-blog(data-action='blog-init' type='submit') SET IT UP button#init-blog(data-action='blog-init' type='submit') SET IT UP

View file

@ -7,13 +7,18 @@
var app = require('./brain/app'); var app = require('./brain/app');
var debug = require('debug')('fipamo:server'); var debug = require('debug')('fipamo:server');
var http = require('http'); var http = require('http');
var config = require('./site/settings.json');
/** /**
* Get port from environment and store in Express. * Get port from environment and store in Express.
*/ */
var port = normalizePort(process.env.PORT || config.global.port); try {
var configPort = require('./site/settings.json').global.port;
} catch (err) {
console.log('settings.json not found, assuming this is a first run...')
}
var port = normalizePort(configPort || process.env.PORT || 2314);
app.set('port', port); app.set('port', port);
/** /**