This commit is contained in:
commit
421043c9b5
67 changed files with 3455 additions and 0 deletions
20
types/server/routes.ts
Normal file
20
types/server/routes.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import type { Server } from "bun";
|
||||
import type { ExtendedRequest } from "./server";
|
||||
|
||||
type RouteDef = {
|
||||
method: string | string[];
|
||||
accepts: string | null | string[];
|
||||
returns: string;
|
||||
needsBody?: "multipart" | "json";
|
||||
};
|
||||
|
||||
type RouteModule = {
|
||||
handler: (
|
||||
request: Request | ExtendedRequest,
|
||||
requestBody: unknown,
|
||||
server: Server,
|
||||
) => Promise<Response> | Response;
|
||||
routeDef: RouteDef;
|
||||
};
|
||||
|
||||
export type { RouteDef, RouteModule };
|
Loading…
Add table
Add a link
Reference in a new issue