-
Notifications
You must be signed in to change notification settings - Fork 375
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
[Bug?]: Cannot use vite proxy with 0.4.x
#1180
Comments
Yeah I had removed some of the proxy features initially from vinxi to keep things simple, since a proxy can be just another API route. But I might bring it back, most likely as the nitro config and not the vite config. What is the use case for the proxy? and does it need to be there both in dev and prod? |
I only need it for dev. My use case is to just to forward it to an existing backend. In prod they will be served by the same server. |
I think this is a bit confusing, I was initially looking for the |
I have a similar use case, currently I'm using solid without solid start, but with webpack and webpack dev server with the following configuration for development:
"/api/tts" proxy to http://127.0.0.1:59125/api/tts I need support for those proxy in development to be able to switch to vite/nitro/vinxi. |
I guess one pending question is, that is it okay for there to be proxies that are dev only (like vite) or proxies should be dev + prod by default, with maybe some way of opting out on either side.. hmm, going to create an issue in vinxi for this. |
Should be fixed with You have to use the export default defineConfig({
start: {
server: {
devProxy: {
"/api/tts": {
target: "http://127.0.0.1:59125",
},
"/openai-worker/completions": {
target: "http://localhost:3000/",
pathRewrite: { "^/openai-worker": "" },
}
}
}
}
}) |
Duplicates
Latest version
Current behavior 😯
This is my config:
The requests that start with
/api
are not forwarded to3001
.I also tried moving the config to the new server part:
Expected behavior 🤔
Requests should be forwarded to configured proxy targets. This use to work prior to
0.4.0
with a similar config:Steps to reproduce 🕹
Steps:
Context 🔦
No response
Your environment 🌎
No response
The text was updated successfully, but these errors were encountered: