Add Vite proxy for API requests to backend during development
Proxy /api/* to http://localhost:8080 so dev frontend can call backend API.
This commit is contained in:
parent
88c870ab3c
commit
516efcebd7
1 changed files with 9 additions and 1 deletions
|
|
@ -3,5 +3,13 @@ import tailwindcss from '@tailwindcss/vite';
|
|||
import { defineConfig } from 'vite';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [tailwindcss(), sveltekit()]
|
||||
plugins: [tailwindcss(), sveltekit()],
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue