createHandle
Since version 3.5
info
The createHandle
is used for the Remix Route
handle export
Arguments:
Name | Type | Description |
---|---|---|
dynamicRoute | DynamicRouteHandle | The dynamic route configuration |
getSitemapEntries | function | Allows to retrieve sitemap entries from a remix route |
sitemapFetcher | string | Allows to retrieve sitemap entries from a registered fetcher |
Example:
import { createHandle } from "@front-commerce/remix/handle";
export const handle = createHandle({
dynamicRoute: {
type: "product", // required
priority: 1, // optional
},
sitemapFetcher: "product",
getSitemapEntries: async () => {
return [
{
loc: "/acme-product.html",
lastmod: new Date().toISOString(),
changefreq: "daily",
priority: 1,
},
];
},
});