Skip to content

Commit

Permalink
Remove env config, add branching
Browse files Browse the repository at this point in the history
It is not as neat to use env configuration, as we are building this into
docker. Instead, we check if we are using dev or prod, and set basepath
respectively.
  • Loading branch information
Mark-Powers committed Aug 30, 2024
1 parent d3b9dab commit 37b7020
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
6 changes: 5 additions & 1 deletion src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { RouterView } from 'vue-router';
import axios from 'axios';
axios.defaults.baseURL = import.meta.env.VITE_API_BASE_URL
if(import.meta.env.PROD){
axios.defaults.baseURL = "https://trovi.chameleoncloud.org"
} else {
axios.defaults.baseURL = "https://trovi-dev.chameleoncloud.org"
}
</script>
<template>
Expand Down
21 changes: 12 additions & 9 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ import vue from '@vitejs/plugin-vue';

// https://vitejs.dev/config/

export default defineConfig({
plugins: [vue()],
server: {
port: 4000,
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
export default defineConfig(({ command }) => {
return {
plugins: [vue()],
server: {
port: 4000,
},
},
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
base: command === 'serve' ? '/' : "/dashboard/", // Set the base URL
}
});

0 comments on commit 37b7020

Please sign in to comment.