Skip to content

Commit

Permalink
fix: configured dev and prod view environments
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <[email protected]>
  • Loading branch information
emoral435 committed Feb 10, 2024
1 parent 0ded15c commit 8db21b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 8 additions & 1 deletion frontend/src/controller/routes.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
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') },
{ path: "/result", component: import('../views/Result.vue') },
]

const router = createRouter({
history: createWebHistory('/planet-foodies/'),
history: createWebHistory(baseURL),
routes,
})

Expand Down
2 changes: 0 additions & 2 deletions frontend/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
// vue.config.js file to be placed in the root of your repository
module.exports = { baseUrl: '/my-first-project/' }

0 comments on commit 8db21b5

Please sign in to comment.