Skip to content

Commit 66c7838

Browse files
authored
Merge pull request #5473 from HSLdevcom/env-cleanup
Remove unused APP_PATH config field
2 parents b9387c9 + 291474f commit 66c7838

File tree

6 files changed

+5
-8
lines changed

6 files changed

+5
-8
lines changed

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ ENV \
8585
MAP_URL='' \
8686
OTP_URL='' \
8787
GEOCODING_BASE_URL='' \
88-
APP_PATH='' \
8988
CONFIG=$CONFIG \
9089
NODE_ENV='' \
9190
RUN_ENV='' \

app/configurations/config.default.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const POI_MAP_PREFIX = `${MAP_URL}/map/v3/finland`;
1313
const OTP_URL = process.env.OTP_URL || `${API_URL}/routing/v2/finland/`;
1414
const HSL_TIMETABLES_URL =
1515
process.env.HSL_TIMETABLES_URL || 'https://dev.kartat.hsl.fi';
16-
const APP_PATH = process.env.APP_CONTEXT || '';
1716
const API_SUBSCRIPTION_QUERY_PARAMETER_NAME =
1817
process.env.API_SUBSCRIPTION_QUERY_PARAMETER_NAME ||
1918
'digitransit-subscription-key';
@@ -121,7 +120,6 @@ export default {
121120
hasAPISubscriptionHeader:
122121
API_SUBSCRIPTION_HEADER_NAME && API_SUBSCRIPTION_TOKEN,
123122

124-
APP_PATH: `${APP_PATH}`,
125123
indexPath: '',
126124
title: 'Reittihaku',
127125

app/meta.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export default function getMetadata(lang, host, url, config) {
2-
const root = config.URL.ASSET_URL || config.APP_PATH;
2+
const root = config.URL.ASSET_URL || '';
33
const path = config.iconPath || 'icons';
44
const iconPath = `${root}/${path}`;
55
const imageHost = config.URL.ASSET_URL || `https://${host}`;

app/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export default async function serve(req, res, next) {
123123

124124
const spriteName = config.sprites;
125125

126-
const ASSET_URL = process.env.ASSET_URL || config.APP_PATH;
126+
const ASSET_URL = process.env.ASSET_URL || '';
127127

128128
res.setHeader('content-type', 'text/html; charset=utf-8');
129129
res.write('<!doctype html>\n');

server/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function setUpStaticFolders() {
8585
.replace(/ASSET_URL/g, process.env.ASSET_URL);
8686
const swTextInjected = swPreText + swInjectionText + swPostText;
8787

88-
app.get(`${config.APP_PATH}/sw.js`, (req, res) => {
88+
app.get('/sw.js', (req, res) => {
8989
res.setHeader('Cache-Control', 'public, max-age=0');
9090
res.setHeader('Content-type', 'application/javascript; charset=UTF-8');
9191
res.send(swTextInjected);
@@ -96,7 +96,7 @@ function setUpStaticFolders() {
9696
// Sert cache for 1 week
9797
const oneDay = 86400000;
9898
app.use(
99-
config.APP_PATH,
99+
'',
100100
expressStaticGzip(staticFolder, {
101101
enableBrotli: true,
102102
index: false,

webpack.config.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ module.exports = {
167167
path: path.join(__dirname, '_static'),
168168
filename: isDevelopment ? 'js/[name].js' : 'js/[name].[chunkhash].js',
169169
chunkFilename: 'js/[chunkhash].js',
170-
publicPath: isDevelopment ? '/proxy/' : `${process.env.APP_PATH || ''}/`,
170+
publicPath: isDevelopment ? '/proxy/' : '/',
171171
crossOriginLoading: 'anonymous',
172172
},
173173
module: {

0 commit comments

Comments
 (0)