-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy-helpers.js
54 lines (52 loc) · 1.59 KB
/
proxy-helpers.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
/* eslint-env es6 */
const ALFRESCO_URL = 'https://...';
module.exports = {
host: {
LOCALHOST_ECM: 'http://127.0.0.1:8080',
LOCALHOST_BPM: 'http://127.0.0.1:9080',
ALFRESCO_URL: ALFRESCO_URL,
},
getIdentityProxy: function (host) {
console.log('Target for /auth', host);
return {
'/auth': {
target: host,
secure: false,
changeOrigin: true,
},
};
},
getEcmProxy: function (host) {
console.log('Target for /alfresco', host);
return {
'/alfresco': {
target: host,
secure: false,
pathRewrite: {
'^/alfresco/alfresco': '',
},
changeOrigin: true,
onProxyReq: function (request) {
if (request['method'] !== 'GET') request.setHeader('origin', host);
},
// workaround for REPO-2260
onProxyRes: function (proxyRes, req, res) {
const header = proxyRes.headers['www-authenticate'];
if (header && header.startsWith('Basic')) {
proxyRes.headers['www-authenticate'] = 'x' + header;
}
},
},
};
},
getBpmProxy: function (host) {
console.log('Target for /activiti-app', host);
return {
'/activiti-app': {
target: host,
secure: false,
changeOrigin: true,
},
};
},
};