-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proxy requests to alternate backend #147
Comments
You can do: export default {
configureServer: ({ app }) => app.use(...)
} Although this is such a common need we may just make it built-in. |
I'm confident I'm doing something wrong. Can you help me find it?
The response is always:
|
Looks like the internal history API fallback is taking higher priority over the proxy middleware. This will need to be fixed. |
@robrich I made a plugin to proxy requests and it mostly works for me. Check out example directory, I just tried it out with latest version of vite ( |
Anyone coming from search engines see here for docs: https://vitejs.dev/config/#server-proxy |
This issue has been locked since it has been closed for more than 14 days. If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion. |
Is your feature request related to a problem? Please describe.
How do I proxy api requests to a different backend? Does it require a Vite plugin?
Describe the solution you'd like
In https://cli.vuejs.org/config/#devserver-proxy it details vue.config.js settings to proxy
/api/*
tohttp://localhost:4000
. I invision something similar:Describe alternatives you've considered
A vite plugin seems overly verbose for this task
Additional context
The text was updated successfully, but these errors were encountered: