refactor: include router directly in fresh (#1122)

This PR changes from depending on https://deno.land/x/rutt to instead
include a reduced & simplified version of it.
This commit is contained in:
Leo Kettmeir
2023-04-18 13:27:51 +02:00
committed by GitHub
parent 2fe1e45975
commit 94d3082c45
4 changed files with 230 additions and 64 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { ComponentType } from "preact";
import { ConnInfo, rutt, ServeInit } from "./deps.ts";
import { ConnInfo, ServeInit } from "./deps.ts";
import * as router from "./router.ts";
import { InnerRenderFunction, RenderContext } from "./render.ts";
// --- APPLICATION CONFIGURATION ---
@@ -87,7 +88,7 @@ export type Handler<T = any, State = Record<string, unknown>> = (
// deno-lint-ignore no-explicit-any
export type Handlers<T = any, State = Record<string, unknown>> = {
[K in typeof rutt.knownMethods[number]]?: Handler<T, State>;
[K in router.KnownMethod]?: Handler<T, State>;
};
export interface RouteModule {