-
So I have an express backend and I've tested it and it works, and I want the vite dev server to proxy all requests starting with export default defineConfig({
// ...
server: {
proxy: {
"^/api/.*": {
target: "http://localhost:8000/api/",
changeOrigin: true,
secure: false
},
"^/auth/.*": {
target: "http://localhost:8000/auth/",
changeOrigin: true,
secure: false
}
}
}
// ...
}); And when I run |
Beta Was this translation helpful? Give feedback.
Answered by
neelkarma
Jun 8, 2021
Replies: 1 comment
-
Nevermind, I figured it out - here's my revised config: export default defineConfig({
// ...
server: {
proxy: {
"^/(api)|(auth)": {
target: "http://localhost:8000",
changeOrigin: true,
secure: false
},
}
}
// ...
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
neelkarma
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nevermind, I figured it out - here's my revised config: