generated from shgysk8zer0/npm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.config.js
More file actions
35 lines (31 loc) · 1022 Bytes
/
http.config.js
File metadata and controls
35 lines (31 loc) · 1022 Bytes
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
import { imports, importmap } from '@shgysk8zer0/importmap';
import { addTrustedTypePolicy, addScriptSrc, addStyleSrc, useDefaultCSP } from '@aegisjsproject/http-utils/csp.js';
addScriptSrc(
'https://unpkg.com/@aegisjsproject/',
'https://unpkg.com/@shgysk8zer0/',
);
addStyleSrc(
importmap.resolve('@aegisjsproject/styles/css/'),
);
addTrustedTypePolicy('aegis-sanitizer#html');
export default {
routes: {
'/': '@aegisjsproject/dev-server',
'/favicon.svg': '@aegisjsproject/dev-server/favicon',
},
port: 8023,
open: true,
requestPreprocessors: [
'@aegisjsproject/http-utils/request-id.js',
],
responsePostprocessors: [
'@aegisjsproject/http-utils/compression.js',
'@aegisjsproject/http-utils/cors.js',
useDefaultCSP(),
(response, { request }) => {
if (request.destination === 'document') {
response.headers.append('Link', `<${imports['@shgysk8zer0/polyfills']}>; rel="preload"; as="script"; fetchpriority="high"; crossorigin="anonymous"; referrerpolicy="no-referrer"`);
}
},
],
};