Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions core/app/sitemap.xml/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
* Proxy to the existing BigCommerce sitemap index on the canonical URL
*/

import { createSitemapHandler } from '@bigcommerce/catalyst-sitemap';

import { getChannelIdFromLocale } from '~/channels.config';
import { client } from '~/client';
import { defaultLocale } from '~/i18n/locales';

export const GET = async () => {
const sitemapIndex = await client.fetchSitemapIndex(getChannelIdFromLocale(defaultLocale));

return new Response(sitemapIndex, {
headers: {
'Content-Type': 'application/xml',
},
});
};
export const GET = createSitemapHandler({
client,
getChannelId: async () => {
return getChannelIdFromLocale(defaultLocale);
},
});
1 change: 1 addition & 0 deletions core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
},
"dependencies": {
"@bigcommerce/catalyst-client": "workspace:^",
"@bigcommerce/catalyst-sitemap": "workspace:^",
"@conform-to/react": "^1.6.1",
"@conform-to/zod": "^1.6.1",
"@icons-pack/react-simple-icons": "^11.2.0",
Expand Down
Loading
Loading