feat: don't require connInfo in request handler (#1278)

This commit is contained in:
Luca Casonato
2023-06-18 21:39:11 +02:00
committed by GitHub
parent d0b277a135
commit 29966ad8bb
4 changed files with 60 additions and 66 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { ServerContext } from "./context.ts";
import * as colors from "https://deno.land/std@0.190.0/fmt/colors.ts";
import { serve, ServeHandler } from "./deps.ts";
import { ConnInfo, serve, ServeHandler } from "./deps.ts";
export { Status } from "./deps.ts";
import {
AppModule,
@@ -69,7 +69,7 @@ export { ServerContext };
export async function createHandler(
routes: Manifest,
opts: StartOptions = {},
) {
): Promise<(req: Request, connInfo?: ConnInfo) => Promise<Response>> {
const ctx = await ServerContext.fromManifest(routes, opts);
return ctx.handler();
}