From a1d1a382d338988a46761ee29aea463fad537db3 Mon Sep 17 00:00:00 2001 From: Nadim Ritter Date: Mon, 23 Sep 2024 13:35:09 +0200 Subject: [PATCH] add hardcoded subpath --- client/src/router/router.ts | 2 +- client/vite.config.mts | 24 +++++++++++++----------- server/src/app.ts | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/client/src/router/router.ts b/client/src/router/router.ts index 443c2ff..5010ca6 100644 --- a/client/src/router/router.ts +++ b/client/src/router/router.ts @@ -125,7 +125,7 @@ const routes: Array = [ ]; const router = createRouter({ - history: createWebHistory(), + history: createWebHistory("/sps-gui"), routes }); diff --git a/client/vite.config.mts b/client/vite.config.mts index f0e0c02..6639af3 100644 --- a/client/vite.config.mts +++ b/client/vite.config.mts @@ -1,38 +1,38 @@ -// Plugins -import vue from "@vitejs/plugin-vue" +import vue from "@vitejs/plugin-vue"; import vuetify, { transformAssetUrls } from "vite-plugin-vuetify"; import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite"; import { gitTagPlugin } from "./src/plugins/vite-plugin-git-tag"; +import { defineConfig } from "vite"; +import { fileURLToPath, URL } from "node:url"; - -// Utilities -import { defineConfig } from "vite" -import { fileURLToPath, URL } from "node:url" - - -// https://vitejs.dev/config/ export default defineConfig({ plugins: [ + vue({ template: { transformAssetUrls } }), - // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin + vuetify({ autoImport: true, }), + VueI18nPlugin({ include: fileURLToPath(new URL("./src/i18n/locales/**", import.meta.url)), }), + // gitTagPlugin() ], + define: { "process.env": {}, _global: ({}) }, + resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)) }, + extensions: [ ".js", ".json", @@ -43,7 +43,9 @@ export default defineConfig({ ".vue", ], }, + server: { port: 8081, }, -}) + +}); \ No newline at end of file diff --git a/server/src/app.ts b/server/src/app.ts index 519b19a..b83e166 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -36,7 +36,7 @@ app.get("/", (req: Request, res: Response) => { res.sendFile(path + "index.html"); }); -app.get("*", (req: Request, res: Response) => { +app.get("/sps-gui/*", (req: Request, res: Response) => { res.sendFile(path + "index.html"); });