Move handler into a different file

This commit is contained in:
Michael Wolf
2025-03-07 21:46:19 -06:00
parent 72284505a0
commit 553cd680dc
2 changed files with 21 additions and 10 deletions

19
deno/handlers.ts Normal file
View File

@@ -0,0 +1,19 @@
import { contentTypes } from "./content-types.ts";
import { httpCodes } from "./http-codes.ts";
import { services } from "./services.ts";
import { Request,Handler, Response } from "./types.ts";
const multiHandler: Handler = (req: Request): Response => {
const code = httpCodes.success.OK;
const rn = services.random.randomNumber();
const retval: Response = {
code,
result: `that was ${req.method} (${rn})`,
contentType: contentTypes.text.plain,
};
return retval;
};
export { multiHandler };