forked from volodymyr-tsaryk/hs-cache-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhs-proxy.config.js
138 lines (136 loc) · 5.29 KB
/
hs-proxy.config.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
var i18Host = 'http://localhost:6060';
//var apiHost = 'http://216.166.0.49/'; //df-testserver4
var apiHost = 'http://qamaster.eng.hotschedules.com/';
//var apiHost = 'http://qamultiserver2.eng.hotschedules.com/';
//var apiHost = 'http://qareleased.eng.hotschedules.com/';
//var apiHost = 'http://app10.eng.hotschedules.com/';
// var apiHost = 'http://beta2.hotschedules.com/';
var staticHost = 'http://localhost:8080/';
var staticOldRedirectHost = 'http://localhost:5000';
var staticLogbookRedirectHost = 'http://localhost:5001';
var staticRedirectHost = 'http://localhost:6500';
var dist16RedirectHost = 'http://localhost:6501';
var schedulingRedirectHost = 'http://localhost:6505';
var bundleHashesToDevReplace = [
'/',
{
from: new RegExp('bundle[.].{1,}[.]js'),
to: 'bundle.dev.js'
}
];
module.exports = {
proxy: {
port: 8003,
static: {
target: staticHost,
removePrefix: 'hs',
requestTimeout: 1200000,
redirect: [
{
from: 'hs/backbone/*.*',
replace: '/',
to: staticRedirectHost
},
// {
// from: 'templates/green/js/scheduling.min.js',
// to: 'backbone/scheduling/config.development.js'
// },
{
from: 'templates/green/js/exceptionsReport.min.js',
to: 'backbone/exceptionsReport/config.development.js'
},
{
from: 'templates/green/js/rosterReport.min.js',
to: 'backbone/report/config.development.js'
},
{
from: 'templates/green/js/exceptionsReport.min.js',
to: 'backbone/report/config.development.js'
},
{
from: 'templates/default/js/newTimeOff/new-timeoff-approvals.min.master.+.js',
to: 'backbone/newTimeOff/approve/approve-main.dev.js'
},
{
from: 'templates/default/js/newTimeOff/new-timeoff-requests.min.master.+.js',
to: 'backbone/newTimeOff/request/request-config.dev.js'
},
{
from: 'templates/green/js/new-forecast.min.master.+.js',
to: 'backbone/forecast/forecast.dev.config.js'
},
{
from: 'startup-page.min.js',
to: 'login/config.js'
},
{
from: '.*update.js$',
replace: '/',
to: staticRedirectHost
},
{
from: '.*update.json$',
replace: '/',
to: staticRedirectHost
},
{
from: '/apps/.*[.js|.css|.json|.woff2|.woff|.ttf]',
replace: bundleHashesToDevReplace,
to: staticRedirectHost
},
{
from: '/apps/dist/modules/.*[.js|.css|.json|.woff2|.woff|.ttf]',
to: staticRedirectHost,
replace: bundleHashesToDevReplace,
},
{
from: "/apps/dist16.*[.js|.css|.json|.woff2|.woff|.ttf]",
replace: bundleHashesToDevReplace,
to: dist16RedirectHost
},
{
from: '/apps/dist/vendor/.*[.js|.css|.json|.woff2|.woff|.ttf]',
to: staticRedirectHost,
replace: bundleHashesToDevReplace,
},
{
from: '/apps/dist/module-launcher/.*[.js|.css|.json|.woff2|.woff|.ttf]',
to: staticRedirectHost,
replace: bundleHashesToDevReplace,
},
{
from: '/templates/green/js/logbook/.*[.js|.css|.json|.woff2|.woff|.ttf]',
replace: bundleHashesToDevReplace,
to: staticLogbookRedirectHost
},
{
from: '/templates/green/js/scheduling/.*[.js|.css|.json|.woff2|.woff|.ttf]',
replace: [
'/',
{
from: new RegExp('scheduling.min[.].{1,}[.]js'),
to: 'scheduling.dev.js'
}
],
to: schedulingRedirectHost
},
{
from: '/apps/dist/punch-records/.*[.js|.css|.json|.woff2|.woff|.ttf]',
replace: bundleHashesToDevReplace,
to: staticOldRedirectHost
},
{
from: '/spring/i18n/resources',
replace: '/',
to: i18Host
}
],
exclude: ['hotschedules.js', 'hotschedules.css', 'jsp/preload'],
include: ['.png$|.js$|.cssv$|.woff$|.css$|i18n/resources|.svg$|.jpg$|.gif$|.html$|.ttf|.ico$|.tpl$|.json$|.woff2$']
},
dynamic: {
target: apiHost,
requestTimeout: 1200000
}
}
};