-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathdev.proxy.js
49 lines (48 loc) · 1.25 KB
/
dev.proxy.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
module.exports = [
{
context: ['/wkylin'],
target: 'https://my-json-server.typicode.com',
// pathRewrite: { '^/wkylin': '/wkylin' },
secure: false,
changeOrigin: true,
},
{
context: ['/v2'],
target: 'https://www.mocky.io',
// pathRewrite: { '^/wkylin': '/wkylin' },
secure: false,
changeOrigin: true,
},
{
context: ['/faker'],
target: 'http://localhost:4000',
pathRewrite: { '^/faker': '' },
secure: false,
changeOrigin: true,
cookieDomainRewrite: 'localhost',
},
]
// module.exports = {
// '/wkylin': {
// // target: 'https://jsonplaceholder.typicode.com',
// // target: service[env.proxy] // --env.proxy=test
// target: 'https://my-json-server.typicode.com',
// // pathRewrite: { '^/wkylin': '/wkylin' },
// secure: false,
// changeOrigin: true,
// },
// '/v2': {
// // target: 'https://jsonplaceholder.typicode.com',
// target: 'https://www.mocky.io',
// // pathRewrite: { '^/wkylin': '/wkylin' },
// secure: false,
// changeOrigin: true,
// },
// '/faker': {
// target: 'http://localhost:4000',
// pathRewrite: { '^/faker': '' },
// secure: false,
// changeOrigin: true,
// cookieDomainRewrite: 'localhost',
// },
// }