Files
agologum/client/src/router/index.ts
Blitblank 728258465d
All checks were successful
Build and Deploy Frontend / build-and-deploy (push) Successful in 6s
working frontend checkpoint
2026-03-08 13:59:35 -05:00

23 lines
644 B
TypeScript

// the router creates front-end endpoints and serves pages to them
import { createRouter, createWebHistory } from "vue-router";
import UsersList from "../pages/UsersList.vue";
import UserForm from "../pages/UserForm.vue";
import index from "../pages/index.vue";
// link path to the page component
const routes = [
{ path: "/", component: index },
{ path: "/users", component: UsersList },
{ path: "/user/new", component: UserForm },
{ path: "/user/:id", component: UserForm }
]; // I really like this
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: routes,
});
export default router;