Amend API path
This commit is contained in:
17
src/main.ts
17
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)
|
||||
|
||||
Reference in New Issue
Block a user