/** * Routes, under the app's base path (/usaco/, from vite.config.js). * * Everything is public; what the admin sees beyond solved problems is decided * by the server per request (the same URLs, more data), so there are no guards. */ import { createRouter, createWebHistory } from "vue-router"; export default createRouter({ history: createWebHistory(import.meta.env.BASE_URL), routes: [ { path: "/", name: "list", component: () => import("@/views/ProblemList.vue") }, { path: "/p/:name", name: "problem", component: () => import("@/views/ProblemPage.vue"), props: true }, { path: "/stats", name: "stats", component: () => import("@/views/StatsPage.vue") }, { path: "/:pathMatch(.*)*", redirect: "/" }, ], scrollBehavior: (to, from, saved) => saved || { top: 0 }, });