diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7cd552f..58e21ff 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,6 +23,7 @@ jobs: run: | yarn install yarn run build + yarn run github-post-build env: NODE_ENV: production diff --git a/github-post-build-script.js b/github-post-build-script.js new file mode 100644 index 0000000..b9da692 --- /dev/null +++ b/github-post-build-script.js @@ -0,0 +1,12 @@ +import viteConfig from "./vite.config.js"; +import * as fs from "fs"; + +const routes = [ + "/menu", + "/watch", + "/auth", +]; +const dir = viteConfig.build.outDir; +for (const route of routes) { + fs.cpSync(dir + "/index.html", dir + route + "/index.html"); +} \ No newline at end of file diff --git a/package.json b/package.json index aaf428a..64ee0b8 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", + "github-post-build": "node github-post-build-script.js", "lint": "vue-cli-service lint", "deploy": "gh-pages -d dist" }, diff --git a/src/router.ts b/src/router.ts index 707e4d3..faedd78 100644 --- a/src/router.ts +++ b/src/router.ts @@ -23,34 +23,38 @@ import { isLoggedin } from "./components/login"; const router = createRouter({ history: createWebHistory(), routes: [ + { + path: "/", + redirect: { name: "Home" } + }, { name: "Login Page", - path: "/login", + path: "login", components: { default: PodLogin }, }, { name: "Home", - path: "/", + path: "/TRIPLE_App/", components: { default: LandingPage }, }, { name: "Data Upload", - path: "/dataUpload", + path: "dataUpload", components: { default: PodUpload }, }, { name: "Pod Browser", - path: "/podBrowser", + path: "podBrowser", components: { default: PodBrowser }, }, { name: "Query", - path: "/dataQuery", + path: "dataQuery", components: { default: DataQuery }, }, { name: "Data Privacy", - path: "/privacy", + path: "privacy", components: { default: EditPrivacy }, }, {