diff --git a/frontend/src/controller/routes.js b/frontend/src/controller/routes.js index 562a528..b34d246 100644 --- a/frontend/src/controller/routes.js +++ b/frontend/src/controller/routes.js @@ -1,4 +1,11 @@ import { createRouter, createWebHistory } from 'vue-router' + +// loading which view to show - dev or prod mode +const baseURL = import.meta.env.VITE_NODE_ENV === "production" + ? "/planet-foodies/" + : "" +console.log({ENV: baseURL}) + // views const routes = [ { path: "/", component: () => import('../views/Home.vue') }, @@ -6,7 +13,7 @@ const routes = [ ] const router = createRouter({ - history: createWebHistory('/planet-foodies/'), + history: createWebHistory(baseURL), routes, }) diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 024f9d3..e69de29 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -1,2 +0,0 @@ -// vue.config.js file to be placed in the root of your repository -module.exports = { baseUrl: '/my-first-project/' } \ No newline at end of file