-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.js
91 lines (74 loc) · 2.24 KB
/
template.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
module.exports = {
// Listen port. Required. Do not forget to update HEALTHCHECK in your Dockerfile if you change this from 8080
port: 8080,
// Served folder configuration
folders: [
{
// Folder on a filesystem
root: 'cra/build/static',
// URL for this folder
path: '/static',
// Which caching headers to send. Usually `immutable` for static content or `short` for everything else
cache: 'immutable',
},
{
root: 'cra/build',
cache: 'short',
},
],
// Index html. Sent for all routes that do not match any files (to enable SPA functionality)
index: 'cra/build/index.html',
// Healthcheck confinguration. Could be `false`, `true` or just path as well
// healthcheck: true,
// healthcheck: false,
// healthcheck: '/healthz',
healthcheck: [
{
// URL to serve healthchecks on
path: '/healthz',
// Data to send in healtcheck
data: function() {
return {
now: new Date().toISOString(),
}
},
},
{
path: '/healthz2',
data: {
status: 'ok',
},
},
],
// Enable Subresource Integrity tag injection into index for styles and scripts
sri: true,
// Inject prefetch links into index HTML for JS and CSS assets
prefetch: true,
// Send 403 for source maps when false. This should be set to `false` in real PROD environment (but `true` is very useful in DEV envs)
sourceMaps: true,
// Send `X-Powered-By` header (SPA-PROD, Express)
poweredBy: true,
// Whitelisted environment variables to be injected into index and served from healthcheck
envs: ['NODE_ENV', 'BASE_URL'],
// Property to inject envs into
envsPropertyName: 'window.__env',
// Basic authentication username and password
username: 'admin',
password: 'admin',
// Enable Content Security Policy. Could be `true` or `false` as well
// csp: true,
// csp: false,
csp: {
// Additional CSP rules
append: {
'script-src': ['https://example.com'],
'img-src': ['data:'],
},
// CSP report uri
reportUri: 'https://example.com/CSP_REPORT',
// Run CSP in report only mode. Requires `reportUri`
reportOnly: false,
// Enable `require-sri-for` directive
requireSri: false,
},
}