From a8ea43194d2be64ff6e78132eb916b5213ebb01e Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 1 Nov 2023 21:12:47 +0000 Subject: [PATCH] Add settings to use npm run dev server with cista -l :8000 backend --- cista-front/vite.config.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cista-front/vite.config.ts b/cista-front/vite.config.ts index 642f4ce..d736cbb 100644 --- a/cista-front/vite.config.ts +++ b/cista-front/vite.config.ts @@ -9,6 +9,15 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"; // @ts-ignore import pluginRewriteAll from 'vite-plugin-rewrite-all'; +// Development mode: +// npm run dev # Run frontend that proxies to dev_backend +// cista -l :8000 --dev # Run backend +const dev_backend = { + target: "http://localhost:8000", + changeOrigin: false, // Use frontend "host" to match "origin" from browser + ws: true, +} + // https://vitejs.dev/config/ export default defineConfig({ plugins: [ @@ -34,6 +43,14 @@ export default defineConfig({ '@': fileURLToPath(new URL('./src', import.meta.url)) } }, + server: { + proxy: { + "/api": dev_backend, + "/files": dev_backend, + "/login": dev_backend, + "/logout": dev_backend, + } + }, build: { outDir: "../cista/wwwroot", emptyOutDir: true,