make more aspects of API & UI hosting configurable

This is necessary to create proper dev & production builds of the app.
This commit is contained in:
ducklet 2021-08-05 19:18:51 +02:00
parent ebdf3a39f3
commit 9acd534706
4 changed files with 13 additions and 8 deletions

View file

@ -1,3 +1,3 @@
export default {
api_url: "http://localhost:8000/api/v1/",
api_url: `${process.env.API_URL}v1/`,
}

View file

@ -3,5 +3,11 @@ import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()]
base: process.env.BASE_URL || "/",
define: {
"process.env.API_URL": JSON.stringify(
process.env.API_URL || "http://localhost:8000/api/",
),
},
plugins: [vue()],
})