Replies: 1 comment
-
we have a plan to improve this, currently we just implement a minimum "rewrites" feature to map pathnames, external URLs will be supported in the future. There is an example i imagine: export default {
rewrite: {
"/api/*": "https://abc.xyz/api/*",
"/api/co": "wss://abc.xyz/api/co",
"/api/users": "/api/v2/users",
"/api/user/[uid]": "/api/v2/user/[uid]",
"/api/upload": (req) => {
if (req.headers.has("aws")) {
return "https://api.aws.com/upload"
}
return "https://api.aliyun.com/upload"
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
CRA supports proxies to backends in development mode. how can I make the proxy the same in aleph.js? Next.js seems to support external URLs through rewrites. thank you for awesome project.
https://gist.github.com/wickedev/8dfbc026e2142a5e82810a2d7a7156a9#file-setupproxy-js
https://create-react-app.dev/docs/proxying-api-requests-in-development
https://nextjs.org/docs/api-reference/next.config.js/rewrites#rewriting-to-an-external-url
Beta Was this translation helpful? Give feedback.
All reactions