refactor: centralize server into ServerContext (#26)

This commit centralizes all server related logic into a central
ServerContext class.
This commit is contained in:
Luca Casonato
2021-06-10 20:46:10 +02:00
committed by GitHub
parent 78c144641c
commit 572b8123c4
9 changed files with 236 additions and 224 deletions
+25
View File
@@ -0,0 +1,25 @@
import { ComponentType } from "../runtime/deps.ts";
import { router } from "./deps.ts";
import { PageProps } from "../runtime/types.ts";
export interface PageModule {
default: ComponentType<PageProps>;
}
export interface Page {
route: string;
url: string;
name: string;
component: ComponentType<PageProps>;
}
export interface ApiRouteModule {
default: router.MatchHandler;
}
export interface ApiRoute {
route: string;
url: string;
name: string;
handler: router.MatchHandler;
}