1
0
mirror of https://github.com/vercel/commerce.git synced 2025-07-22 20:26:49 +00:00
Files
.vscode
assets
components
config
docs
framework
lib
pages
public
.editorconfig
.env.template
.gitignore
.prettierignore
README.md
codegen.json
commerce.config.json
global.d.ts
license.md
next-env.d.ts
next.config.js
package.json
postcss.config.js
tailwind.config.js
tsconfig.json
yarn.lock
commerce/next.config.js
Luis Alvarez e90d9a2121 Fixed types
2021-02-25 17:18:50 -05:00

42 lines
1.1 KiB
JavaScript

const commerce = require('./commerce.config.json')
const withCommerceConfig = require('./framework/commerce/with-config')
const isBC = commerce.provider === 'bigcommerce'
const isShopify = commerce.provider === 'shopify'
module.exports = withCommerceConfig({
commerce,
i18n: {
locales: ['en-US', 'es'],
defaultLocale: 'en-US',
},
rewrites() {
return [
(isBC || isShopify) && {
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!
isBC && {
source: '/logout',
destination: '/api/bigcommerce/customers/logout?redirect_to=/',
},
// Rewrites for /search
{
source: '/search/designers/:name',
destination: '/search',
},
{
source: '/search/designers/:name/:category',
destination: '/search',
},
{
// This rewrite will also handle `/search/designers`
source: '/search/:category',
destination: '/search',
},
].filter((x) => x)
},
})