Skip to content

Commit ce20bb4

Browse files
committed
Turn 'SupportedFramework' to string enum
1 parent 6fd2c09 commit ce20bb4

File tree

1 file changed

+3
-3
lines changed
  • packages/remix/src/utils/serverAdapters

1 file changed

+3
-3
lines changed

packages/remix/src/utils/serverAdapters/shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ type SupportedRequest = FastifyRequest | ExpressRequest;
2121
type SupportedResponse = FastifyReply | ExpressResponse;
2222

2323
export enum SupportedFramework {
24-
Express,
25-
Fastify,
24+
Express = 'express',
25+
Fastify = 'fastify',
2626
}
2727

2828
export type AugmentedResponse = {
@@ -195,7 +195,7 @@ export const prepareWrapCreateRequestHandler = (forFramework: SupportedFramework
195195
): (this: unknown, options: CreateRequestHandlerOptions) => GenericRequestHandler {
196196
return function (this: unknown, opts: CreateRequestHandlerOptions): GenericRequestHandler {
197197
if (!opts.getLoadContext) opts['getLoadContext'] = () => ({});
198-
fill(opts, 'getLoadContext', wrapGetLoadContext('fastify'));
198+
fill(opts, 'getLoadContext', wrapGetLoadContext(forFramework));
199199
const build = typeof opts.build === 'function' ? wrapBuildFn(opts.build) : instrumentBuild(opts.build, true);
200200
const handler: GenericRequestHandler = createRequestHandler.call(this, { ...opts, build });
201201
return wrapRequestHandler(handler, forFramework, build);

0 commit comments

Comments
 (0)