ยฉ 2026 Hedgehog Software, LLC
.env.local
VITE_API_HOST=https://test.com/backend
vite.config.js
import solid from "solid-start/vite"; import { defineConfig, loadEnv } from "vite"; export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd()); return { plugins: [ solid({ ssr: false }), ], server: { proxy: { "/backend": { target: env.VITE_API_HOST, changeOrigin: true, rewrite: (path) => path.replace(/^\/backend/, ""), secure: false }, }, }, }; });
import { defineConfig } from "@solidjs/start/config"; export default defineConfig({ start: { ssr: false, }, server: { proxy: { "/backend": { target: process.env.VITE_API_HOST, changeOrigin: true, rewrite: (path) => path.replace(/^\/backend/, ""), secure: false }, }, }, });
process.env.VITE_API_HOST