Open FDiskas opened 3 years ago
Hi @FDiskas
Unfortunately, there are too many features that overlap with httpProxyMiddleware, so I think it would be better to provide guidance on how to use httpProxyMiddleware rather than adding new features anymore. (httpProxyMiddleware provides more features)
As an alternative, try httpProxyMiddleware and the source code below.
import {createProxyMiddleware} from'http-proxy-middleware';
export default createProxyMiddleware({
timeout: 3000,
target:'http://localhost:8080',
router: {
'/api/demo':'https://google.com',
},
pathRewrite: {
'/api/demo':'',
},
});
Thanks 😀
Unable to use path rewrite to external endpoint. using vanila
http-proxy-middleware
it is possible using router https://github.com/chimurai/http-proxy-middleware/blob/c935888ea7135365bea3c4c81e4ffe48f359a670/examples/response-interceptor/index.js#L39Pseudo code
As a workaround i create multiple files with different target option