-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass app load context to export sitemap function #6
Comments
this not be possible because in the remix code each server platform package send the app load context in a |
Looks like the export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext,
loadContext: AppLoadContext // <- Here
) {
if (isSitemapUrl(request)) {
return sitemap(request, remixContext)
}
return isbot(request.headers.get("user-agent"))
? handleBotRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
)
: handleBrowserRequest(
request,
responseStatusCode,
responseHeaders,
remixContext
);
} Now that can be sent throught sitemap response function and getted as a property in the example: export const sitemap: SitemapFunction = async ({ context }) => {
const posts = await context.api.posts.list();
return posts.map(post => ({
loc: `/posts/${post.slug}`
}));
} |
can be helpful get the loader context in the
generateEntries
for cloudflarekv
, dependency injection, etcThe text was updated successfully, but these errors were encountered: