// 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;