diff --git a/client/template.js b/client/template.js index eaf732936..b61d6df30 100644 --- a/client/template.js +++ b/client/template.js @@ -1,5 +1,5 @@ module.exports = async(name, title = '', props = {})=>{ - const HOMEBREWERY_PUBLIC_URL=(process.env.NODE_ENV == 'local' ? 'localhost:8000' : 'https://homebrewery.naturalcrit.com'); + const HOMEBREWERY_PUBLIC_URL=(props.publicUrl ? props.publicUrl : 'https://homebrewery.naturalcrit.com'); return ` diff --git a/config/default.json b/config/default.json index f74ce3b8e..f3a8f937d 100644 --- a/config/default.json +++ b/config/default.json @@ -3,5 +3,6 @@ "naturalcrit_url" : "local.naturalcrit.com:8010", "secret" : "secret", "web_port" : 8000, - "enable_v3" : true + "enable_v3" : true, + "publicUrl" : "localhost:8000" } diff --git a/server/app.js b/server/app.js index de51c8882..4113e93be 100644 --- a/server/app.js +++ b/server/app.js @@ -264,6 +264,7 @@ const templateFn = require('./../client/template.js'); app.use((req, res)=>{ const props = { version : require('./../package.json').version, + publicUrl : config.get('publicUrl'), url : req.originalUrl, brew : req.brew, brews : req.brews,