-
With 0.3 and 0.5 I was using a import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
server: {
proxy: {
"/api": "https://my.apiserver.org",
},
},
}); This is no longer working after the update to 0.6, has the configuration been changed? I now realize that the concept of a "server" is a little different in Start than in a pure SolidJS project, but I'm still after the functionality that when I'm in dev mode, Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Have you tried putting it in export default defineConfig({
vite: {
server: {
proxy: {
"/api": "https://my.apiserver.org",
},
},
},
}); |
Beta Was this translation helpful? Give feedback.
-
For who wants to rewrite proxy paths in Solid Start you can follow below Vite Server Proxy Guide to apply path rewrite like below: Vite Server Proxy: https://vite.dev/config/server-options.html#server-proxy import { defineConfig } from "@solidjs/start/config";
export default defineConfig({
vite: {
plugins: [
// ...
],
server: {
// ✅ e.g. https://vite.dev/config/server-options.html#server-proxy
proxy: {
"/api/auth": "http://localhost:8090",
// ✅ with options:
// ✅ http://localhost:3000/api/v1/cms/*
// ✅ -> http://localhost:8091/*
"/api/v1/cms": {
target: "http://localhost:8091",
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/api\/v1\/cms/, ""),
},
},
},
},
}); |
Beta Was this translation helpful? Give feedback.
Have you tried putting it in
vite.server.proxy
. We moved the vite settings from top level to into the vite property.