Skip to content

Commit

Permalink
make getLoadContext not option for RemixMiddlewareOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Sep 23, 2024
1 parent 81cbf5f commit 9a62e55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cloudflare-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import type { GetLoadContext } from './remix'
interface RemixMiddlewareOptions {
build: ServerBuild
mode?: 'development' | 'production'
getLoadContext?: GetLoadContext
getLoadContext: GetLoadContext
}

function remix({ mode, build, getLoadContext }: RemixMiddlewareOptions) {
return createMiddleware(async (c) => {
const requestHandler = createRequestHandler(build, mode)
const args = createGetLoadContextArgs(c)

// @ts-expect-error not typed well
const loadContext = getLoadContext(args)
return await requestHandler(
c.req.raw,
Expand Down

0 comments on commit 9a62e55

Please sign in to comment.