Skip to content

Commit

Permalink
Merge pull request #13 from J-E-N-G-A/fix/gh-acitons-with-routing
Browse files Browse the repository at this point in the history
Fix/gh acitons with routing
  • Loading branch information
emoral435 authored Feb 10, 2024
2 parents 41f530e + 8db21b5 commit 95cdd3c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions frontend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_NODE_ENV='development'
1 change: 1 addition & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_NODE_ENV='production'
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(),
history: createWebHistory(baseURL),
routes,
})

Expand Down
Empty file added frontend/vue.config.js
Empty file.

0 comments on commit 95cdd3c

Please sign in to comment.