From 8a821c7861d3cf13a3853ffd395d7cf69b4be863 Mon Sep 17 00:00:00 2001 From: MagicalCodeMonkey Date: Sat, 21 Mar 2020 16:33:23 -0400 Subject: [PATCH] Put env PORT back in place for compatibility Update some output/comments --- webapp.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/webapp.js b/webapp.js index d8a70615..07f589ba 100644 --- a/webapp.js +++ b/webapp.js @@ -1,7 +1,7 @@ // ABOUT // Runs the SyncLounge Web App - handles serving the static web content and link shortening services // Port defaults to 8088 -// REQUIRED: Access URL must be set using --accessUrl= or accessUrl ENV variable +// REQUIRED: Access URL must be set. See documentation for how to set this. const express = require('express'); const path = require('path'); @@ -14,12 +14,11 @@ const SailsDisk = require('sails-disk'); const SettingsHelper = require('./SettingsHelper'); const settings = new SettingsHelper(); -console.log('Settings', settings); -let PORT = settings.webapp_port || 8088; +let PORT = process.env['PORT'] ||settings.webapp_port || 8088; const bootstrap = () => new Promise(async (resolve, reject) => { if (!settings.accessUrl) { - console.log('Missing required argument `accessUrl`. EG. "node webapp.js -accessUrl=http://sl.example.com". This URL is used for redirecting invite links.'); + console.log('Missing required argument `accessUrl`. This URL is used for redirecting invite links. See documentation for how to set this'); return reject(new Error('Missing URL for invite links')); } if (!settings.webapp_port) {