Skip to content

Commit 2cbd1bf

Browse files
committed
Added redirect rule
1 parent 45116b1 commit 2cbd1bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/routes.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import ProductList from './ProductList.vue';
2-
import Cart from './Cart.vue';
32
import ViewProduct from './ViewProduct.vue';
3+
import Cart from './Cart.vue';
44

55
export const routes = [
6+
// LEGACY ROUTES
7+
{ path: '/products/:productId/view', redirect: { name: 'viewProduct' } },
8+
// /LEGACY ROUTES
9+
610
{ path: '', component: ProductList },
7-
{ path: '/cart', component: Cart },
811
{ path: '/products/:productId', name: 'viewProduct', props: true, component: ViewProduct },
12+
{ path: '/cart', component: Cart },
913
{ path: '*', component: { template: '<h1>Page Not Found!</h1>' } }
1014
];

0 commit comments

Comments
 (0)