This commit is contained in:
Michael Wolf
2025-03-07 15:23:38 -06:00
parent d48a533d42
commit c19e6a9537

View File

@@ -3,14 +3,20 @@
import { sleep } from "https://deno.land/x/sleep/mod.ts";
import { HttpCode, httpCodes } from "./http-codes.ts";
import { ContentType, contentTypes } from "./content-types";
import { services } from "./services";
import {DenoRequest, Handler, Response, Method, UserRequest, Request, Route, ProcessedRoute } from './types.ts'
import { ContentType, contentTypes } from "./content-types.ts";
import { services } from "./services.ts";
import {
DenoRequest,
Handler,
Method,
ProcessedRoute,
Request,
Response,
Route,
UserRequest,
} from "./types.ts";
const phandler: Handler = async (req: Request) => {
const phandler: Handler = async (_req: Request) => {
const code = httpCodes.success.OK;
return {
code,
@@ -19,8 +25,6 @@ const phandler: Handler = async (req: Request) => {
};
};
// FIXME: Obviously put this somewhere else
const okText = (out: string) => {
const code = httpCodes.success.OK;
@@ -39,7 +43,8 @@ const routes: Route[] = [
handler: async (_req) => {
console.log("starting slow request");
await sleep(10);
console.log("finishing slow request"); return okText("that was slow");
console.log("finishing slow request");
return okText("that was slow");
},
},
{
@@ -91,11 +96,4 @@ const routes: Route[] = [
},
];
export {routes}
export { routes };