From c8c7df7c3c80ed36f8d3212c04de26ffdfe65cec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sun, 17 Mar 2024 11:20:33 +0100 Subject: [PATCH] add proxy server. --- vite.config.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 5c45e1d9..acf37696 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,5 +12,15 @@ export default defineConfig({ alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } + }, + server: { + port: 3001, + proxy: process.env.NEKO_HOST ? { + '/api': { + target: 'http://' + process.env.NEKO_HOST + ':' + process.env.NEKO_PORT + '/', + changeOrigin: true, + ws: true + } + } : undefined } })