diff --git a/.env b/.env new file mode 100644 index 0000000..d31cb27 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VITE_BASE_PATH=/quiver-frontend/ +VITE_BASE_API_URL=https://quiver-dev.sub.uni-goettingen.de/api diff --git a/src/helpers/api.ts b/src/helpers/api.ts index 9821708..df28548 100644 --- a/src/helpers/api.ts +++ b/src/helpers/api.ts @@ -1,7 +1,7 @@ import type { EvalDefinitions, EvaluationRun, GroundTruth, Project, Release, Workflow } from "@/types" const baseUrlOld = 'https://raw.githubusercontent.com/OCR-D/quiver-back-end/main/data' -const baseUrl = 'https://quiver-dev.sub.uni-goettingen.de/api' +const baseUrl = import.meta.env.VITE_BASE_API_URL async function getProjects(): Promise { return await request(baseUrlOld + '/repos.json') } @@ -40,7 +40,7 @@ async function getLatestRuns(gtId?: string, workflowId?: string): Promise { + const env = loadEnv(mode, process.cwd(), '') + return { + base: env.VITE_BASE_PATH, + build: { + outDir: 'dist', + }, + publicDir: 'assets', + plugins: [ + vue(), + VueI18nPlugin({ + // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` + // compositionOnly: false, - // you need to set i18n resource including paths ! - include: path.resolve(__dirname, './src/locales/**') - }), - ], - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) + // you need to set i18n resource including paths ! + include: path.resolve(__dirname, './src/locales/**') + }), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } } } })