From 16ae32b8819f1a810da2ec73d7f835e6ca2e40b1 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 13 Apr 2022 09:12:48 +1200 Subject: [PATCH] Move default URL check to app.js --- client/template.js | 2 +- server/app.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/template.js b/client/template.js index 0d94f8630..36eb707bf 100644 --- a/client/template.js +++ b/client/template.js @@ -1,5 +1,5 @@ module.exports = async(name, title = '', props = {})=>{ - const HOMEBREWERY_PUBLIC_URL=(props.publicUrl ? props.publicUrl : 'https://homebrewery.naturalcrit.com'); + const HOMEBREWERY_PUBLIC_URL=props.publicUrl ?? ''; return ` diff --git a/server/app.js b/server/app.js index 4113e93be..4472bb360 100644 --- a/server/app.js +++ b/server/app.js @@ -264,7 +264,7 @@ const templateFn = require('./../client/template.js'); app.use((req, res)=>{ const props = { version : require('./../package.json').version, - publicUrl : config.get('publicUrl'), + publicUrl : config.get('publicUrl') ?? 'https://homebrewery.naturalcrit.com', url : req.originalUrl, brew : req.brew, brews : req.brews,