mirror of
https://github.com/vercel/commerce.git
synced 2025-03-14 22:42:33 +00:00
Updated rewrites
This commit is contained in:
parent
3eb9fd87ec
commit
dfdad2cd7a
@ -1,7 +1,5 @@
|
||||
|
||||
|
||||
const bundleAnalyzer = require('@next/bundle-analyzer')({
|
||||
enabled: !!process.env.BUNDLE_ANALYZE
|
||||
enabled: !!process.env.BUNDLE_ANALYZE,
|
||||
})
|
||||
|
||||
module.exports = bundleAnalyzer({
|
||||
@ -14,33 +12,17 @@ module.exports = bundleAnalyzer({
|
||||
},
|
||||
rewrites() {
|
||||
return [
|
||||
{
|
||||
source: '/:locale/checkout',
|
||||
destination: '/api/bigcommerce/checkout',
|
||||
},
|
||||
{
|
||||
source: '/checkout',
|
||||
destination: '/api/bigcommerce/checkout',
|
||||
},
|
||||
// The logout is also an action so this route is not required, but it's also another way
|
||||
// you can allow a logout!
|
||||
{
|
||||
source: '/:locale/logout',
|
||||
destination: '/api/bigcommerce/customers/logout?redirect_to=/',
|
||||
},
|
||||
{
|
||||
source: '/logout',
|
||||
destination: '/api/bigcommerce/customers/logout?redirect_to=/',
|
||||
},
|
||||
// Rewrites for /search
|
||||
{
|
||||
source: '/:locale/search',
|
||||
destination: '/search',
|
||||
},
|
||||
{
|
||||
source: '/:locale/search/:path*',
|
||||
destination: '/search',
|
||||
},
|
||||
{
|
||||
source: '/search/designers/:name',
|
||||
destination: '/search',
|
||||
@ -53,8 +35,7 @@ module.exports = bundleAnalyzer({
|
||||
// This rewrite will also handle `/search/designers`
|
||||
source: '/search/:category',
|
||||
destination: '/search',
|
||||
locale: false
|
||||
},
|
||||
]
|
||||
},
|
||||
});
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user