Skip to content

Commit 7218ddb

Browse files
author
Brijesh
committed
Caddy
1 parent 8f7b28c commit 7218ddb

2 files changed

Lines changed: 39 additions & 36 deletions

File tree

Caddyfile

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
{
22
auto_https off
33
}
4-
:2015
5-
6-
root * /srv
7-
file_server
8-
9-
10-
log {
11-
level INFO
12-
}
13-
encode gzip
14-
try_files {path} /index.html
15-
templates /static/js/* {
16-
mime application/javascript
17-
}
18-
19-
header /service-worker.js {
20-
Cache-Control max-age=0,no-cache,no-store,must-revalidate
21-
}
22-
23-
header /index.html {
24-
Cache-Control max-age=0,no-cache,no-store,must-revalidate
25-
}
26-
27-
header /static/* {
28-
Cache-Control max-age=604800,public
29-
}
30-
31-
header /images/* {
32-
Cache-Control max-age=604800,public
33-
}
34-
35-
header /manifest.json {
36-
Cache-Control max-age=3600
4+
:2015 {
5+
root * /srv
6+
log {
7+
level INFO
8+
}
9+
10+
# Enable templates and include JS MIME for {env.VAR} substitution
11+
templates {
12+
mime text/html application/javascript
13+
}
14+
15+
# Compress everything except JS (JS is already minified)
16+
@compressible {
17+
not path /static/js/*
18+
}
19+
encode @compressible gzip
20+
21+
try_files {path} /index.html
22+
file_server
23+
24+
# Your headers...
25+
header /service-worker.js {
26+
Cache-Control max-age=0,no-cache,no-store,must-revalidate
27+
}
28+
header /index.html {
29+
Cache-Control max-age=0,no-cache,no-store,must-revalidate
30+
}
31+
header /static/* {
32+
Cache-Control max-age=604800,public
33+
}
34+
header /images/* {
35+
Cache-Control max-age=604800,public
36+
}
37+
header /manifest.json {
38+
Cache-Control max-age=3600
39+
}
3740
}

src/constants/api.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ export const DEV_ENV = {
3333
};
3434

3535
export const SSO_BASE_URL = isBundled
36-
? '{{env "SSO_BASE_URL"}}' // Caddy will replace this with the environment variable configured in Openshift
36+
? '{env.SSO_BASE_URL}' // Caddy will replace this with the environment variable configured in Openshift
3737
: DEV_ENV.SSO_BASE_URL;
3838

39-
export const SSO_REALM_NAME = isBundled ? '{{env "SSO_REALM_NAME"}}' : process.env.REACT_APP_SSO_REALM_NAME;
40-
export const SSO_CLIENT_ID = isBundled ? '{{env "SSO_CLIENT_ID"}}' : process.env.REACT_APP_SSO_CLIENT_ID;
39+
export const SSO_REALM_NAME = isBundled ? '{{env.SSO_REALM_NAME}}' : process.env.REACT_APP_SSO_REALM_NAME;
40+
export const SSO_CLIENT_ID = isBundled ? '{env.SSO_CLIENT_ID}' : process.env.REACT_APP_SSO_CLIENT_ID;
4141
export const SSO_BASE_AUTH_ENDPOINT = `${SSO_BASE_URL}/auth/realms/${SSO_REALM_NAME}/protocol/openid-connect`;
4242
export const SSO_LOGIN_REDIRECT_URI = `${window.location.origin}/return-page?type=${RETURN_PAGE_TYPE.LOGIN}`;
4343
export const SSO_LOGIN_ENDPOINT = `${SSO_BASE_AUTH_ENDPOINT}/auth?response_type=code&client_id=${SSO_CLIENT_ID}&redirect_uri=${SSO_LOGIN_REDIRECT_URI}&code_challenge_method=S256&code_challenge=_CODE_CHALLENGE_VALUE_`;

0 commit comments

Comments
 (0)