Skip to content

Commit 03c24a1

Browse files
authored
Merge pull request #5848 from HSLdevcom/AB#593
Ab#593: Static files configuration
2 parents 38d884e + 76e31b5 commit 03c24a1

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

app/component/AppBarHsl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ const AppBarHsl = ({ lang, user, favourites }, context) => {
207207
{!config.hideHeader && (
208208
<SiteHeader
209209
baseUrl={config.URL.ROOTLINK}
210-
staticAssetsUrl="/static-assets"
210+
staticAssetsUrl={config.URL.STATIC_ASSETS}
211211
lang={lang}
212212
userMenu={userMenu}
213213
langMenu={languages}

app/configurations/config.hsl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ const SUGGESTION_URL = process.env.CONTENT_DOMAIN
1818
? `${process.env.CONTENT_DOMAIN}/api/v1/search/suggestions`
1919
: 'https://content.hsl.fi/api/v1/search/suggestions'; // old url
2020
const travelersAccountUrl = process.env.TRAVELERS_ACCOUNT_URL;
21-
const staticAssetsUrl = process.env.STATIC_ASSETS_URL;
21+
const staticAssetsUrl =
22+
process.env.STATIC_ASSETS_URL || 'https://staticfiles-test.hslfi.hsldev.com/';
2223

2324
const virtualMonitorBaseUrl = IS_DEV
2425
? 'https://dev-hslmonitori.digitransit.fi'

server/server.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,6 @@ function setUpMiddleware() {
123123
// proxy for dev-bundle
124124
app.use('/proxy/', proxy(`http://localhost:${hotloadPort}/`));
125125
}
126-
// Proxy static assets to avoid CORS issues when fetching from the browser
127-
// TODO this is a hacky solution, contact site-header admins to update site-header cors settings.
128-
const staticAssetsBaseUrl = process.env.STATIC_ASSETS_URL;
129-
if (staticAssetsBaseUrl) {
130-
app.use(
131-
'/static-assets',
132-
proxy(staticAssetsBaseUrl, {
133-
proxyReqPathResolver: req => req.url,
134-
}),
135-
);
136-
}
137126
}
138127

139128
function onError(err, req, res) {

0 commit comments

Comments
 (0)