0.0.20 • Published 1 year ago
fe-dev-server-plugin-proxy v0.0.20
fe-dev-server-plugin-proxy
A plugin for request proxy
Config
target
string / object - the proxy target for request, supporting multiple target with different url prefix, for examples:
// single target
({
target: 'http://localhost:8080'
})
// multiple target with different url
({
target: {
'/api': 'http://localhost:8080',
'/static': 'http://localhost:8081',
}
})
secure
true / false, Default: true - if you want to verify the SSL Certs
changeOrigin
true / false, Default: true - changes the origin of the host header to the target URL
requestInterceptor
function - modify the request sending to target, allow pathname / headers / method / search, for examples:
// using the return of requestInterceptor to modify request
({
requestInterceptor: ({ pathname, headers, method, search }) => ({
pathname,
headers: { ...headers, 'custom-header': 'value' },
method,
search,
})
})
responseInterceptor
function - modify the response sending to client, allow headers / statusCode, for examples:
({
responseInterceptor: ({ headers, statusCode }) => ({
headers: {
...headers,
'custom-header': 'value',
},
})
})
0.0.20
1 year ago
0.0.18
1 year ago
0.0.19
1 year ago
0.0.17
1 year ago
0.0.16
1 year ago
0.0.11
2 years ago
0.0.12
2 years ago
0.0.13
2 years ago
0.0.14
2 years ago
0.0.15
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago