diff --git a/package-lock.json b/package-lock.json index 66f66db..3277faf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dex-ui-vue", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 22dab74..4856f82 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dex-ui-vue", "private": true, - "version": "0.0.1", + "version": "0.0.2", "type": "module", "scripts": { "dev": "vite", diff --git a/src/main.ts b/src/main.ts index e768b8a..215d19d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -27,16 +27,11 @@ import axiosInstance from "./api"; import SetsView from "./views/set/SetsView.vue"; import JobsView from "./views/JobsView.vue"; import {definePreset} from "@primeuix/themes"; -import {getConfig, initConfig} from "@/util/config.ts"; +import {initConfig} from "@/util/config.ts"; // Initialize configuration from window object initConfig((window as any).__APP_CONFIG__ || {}) -// Use the config in your app -const config = getConfig() -console.log('API Base URL:', config.API_BASE_URL) - - export const DeckServiceKey = Symbol("deckServiceKey") export const CardServiceKey = Symbol("cardServiceKey") export const SetServiceKey = Symbol("setServiceKey") @@ -144,11 +139,11 @@ router.beforeEach(async (to) => { app.use(router); app.use(ToastService) -const deckService: DeckService = new DeckService(undefined, config.API_BASE_URL, axiosInstance) -const cardService: CardService = new CardService(undefined, config.API_BASE_URL, axiosInstance) -const setService: SetService = new SetService(undefined, config.API_BASE_URL, axiosInstance) -const cardPrintService: CardPrintService = new CardPrintService(undefined, config.API_BASE_URL, axiosInstance) -const jobService: JobService = new JobService(undefined, config.API_BASE_URL, axiosInstance) +const deckService: DeckService = new DeckService(undefined, "/api", axiosInstance) +const cardService: CardService = new CardService(undefined, "/api", axiosInstance) +const setService: SetService = new SetService(undefined, "/api", axiosInstance) +const cardPrintService: CardPrintService = new CardPrintService(undefined, "/api", axiosInstance) +const jobService: JobService = new JobService(undefined, "/api", axiosInstance) app.provide(DeckServiceKey, deckService) app.provide(CardServiceKey, cardService) diff --git a/vite.config.ts b/vite.config.ts index 5019edb..e692597 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -24,6 +24,16 @@ export default defineConfig({ '@': path.resolve(__dirname, './src'), } }, + server: { + proxy: { + '/api': { + target: 'http://localhost:8080', + changeOrigin: true, + secure: true, + rewrite: (path) => path.replace(/^\/api/, '') + } + } + }, build: { // @ts-ignore assetsInclude: [