added BASE_URL environment variable

This commit is contained in:
Danny Coates 2017-08-11 14:02:44 -07:00
parent dafe00cabb
commit c488c1d724
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
3 changed files with 11 additions and 16 deletions

View File

@ -51,6 +51,11 @@ const conf = convict({
format: Boolean, format: Boolean,
default: false, default: false,
env: 'L10N_DEV' env: 'L10N_DEV'
},
base_url: {
format: 'url',
default: 'https://send.firefox.com',
env: 'BASE_URL'
} }
}); });

View File

@ -38,16 +38,6 @@ function prodLangs() {
const availableLanguages = conf.l10n_dev ? allLangs() : prodLangs(); const availableLanguages = conf.l10n_dev ? allLangs() : prodLangs();
const envURL = (env) => {
switch (env) {
case 'test':
return 'https://send.stage.mozaws.net';
case 'development':
return 'https://testpilot.dev.mozaws.net';
}
return 'https://send.firefox.com';
}
if (conf.env === 'development') { if (conf.env === 'development') {
const webpack = require('webpack'); const webpack = require('webpack');
const webpackDevMiddleware = require('webpack-dev-middleware'); const webpackDevMiddleware = require('webpack-dev-middleware');
@ -69,7 +59,7 @@ app.engine(
helpers: { helpers: {
availableLanguages, availableLanguages,
l10nDev: conf.l10n_dev, l10nDev: conf.l10n_dev,
envURL: envURL(conf.env), baseUrl: conf.base_url,
title: 'Firefox Send', title: 'Firefox Send',
description: 'Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever.' description: 'Encrypt and send files with a link that automatically expires to ensure your important documents dont stay online forever.'
} }

View File

@ -7,15 +7,15 @@
<meta name="defaultLanguage" content="en-US"> <meta name="defaultLanguage" content="en-US">
<meta name="availableLanguages" content="{{availableLanguages}}"> <meta name="availableLanguages" content="{{availableLanguages}}">
<meta property="og:title" content="Firefox Send"/> <meta property="og:title" content="{{title}}"/>
<meta name="twitter:title" content="Firefox Send"/> <meta name="twitter:title" content="{{title}}"/>
<meta name="description" content="{{description}}"/> <meta name="description" content="{{description}}"/>
<meta property="og:description" content="{{description}}"/> <meta property="og:description" content="{{description}}"/>
<meta name="twitter:description" content="{{description}}"/> <meta name="twitter:description" content="{{description}}"/>
<meta name="twitter:card" content="summary"/> <meta name="twitter:card" content="summary"/>
<meta property="og:image" content="{{envURL}}/resources/send-fb.jpg"/> <meta property="og:image" content="{{baseUrl}}/resources/send-fb.jpg"/>
<meta name="twitter:image" content="{{envURL}}/resources/send-twitter.jpg"/> <meta name="twitter:image" content="{{baseUrl}}/resources/send-twitter.jpg"/>
<meta property="og:url" content="{{envURL}}"/> <meta property="og:url" content="{{baseUrl}}"/>
<title>{{title}}</title> <title>{{title}}</title>