aboutsummaryrefslogblamecommitdiff
path: root/client/src/router/index.js
blob: eee610c0a07b522bf15a140cbb8e9740c9b8ecfc (plain) (tree)
1
2
3
4
5
6
                                                          




                                            







                   

















                         
   
  



                                                  
   
 
                      
import {createRouter, createWebHistory} from 'vue-router';
import Home from '@/views/Home.vue';
import Product from '@/views/Product.vue';
import Checkout from '@/views/Checkout.vue';
import Login from '@/views/Login.vue';
import Register from '@/views/Register.vue';

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/product/:id',
    name: 'Product',
    component: Product
  },
  {
    path: '/checkout',
    name: 'Checkout',
    component: Checkout
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});

export default router;