MRE for unjs/nitro#1643
Nitro devProxy drops basepath of proxied server (only accepts Protocol, Host and Port of URL)
{
devProxy: {
"/api": {
target: "http://localhost:3001/api"
}
}
}
http://nitro:3000/api/foo => http://server:3001/api/foo
http://nitro:3000/api/foo => http://server:3001/foo
Simple HTTP Server listening on 3001 responding with api_path: ${req.url}
Simple HTTP Server elevating httpxy to server /api
via Proxy
Nitro stater sample, with devProxy
- add proxy2 to httpxy_mre
/foo
as entrypoint- initialize directly on proxy creation (similar to nitro dev/server.ts)
- add
/foo
to nitro devProxy - add
/bar
to httpxy_mre- acutally httpxy is ignoring the path
- nitro is just dropping the path of the route