Skip to content

Commit edc9b00

Browse files
committed
fix(app): proxy
1 parent 4d09549 commit edc9b00

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

app2/vite.config.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ export default defineConfig({
1010
},
1111
plugins: [sveltekit(), tailwindcss()],
1212
build: { sourcemap: true },
13-
server: { allowedHosts: true },
13+
server: {
14+
allowedHosts: true,
15+
proxy: {
16+
"/api/union": {
17+
target: "https://rest.union.build",
18+
changeOrigin: true,
19+
rewrite: (path) => path.replace(/^\/api\/union/, ""),
20+
configure: (proxy) => {
21+
proxy.on("proxyReq", (proxyReq) => {
22+
proxyReq.setHeader("origin", "https://rest.union.build")
23+
})
24+
},
25+
},
26+
},
27+
},
1428
test: {
1529
workspace: [
1630
{

0 commit comments

Comments
 (0)