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