Add a first cut at an express-based backend

This commit is contained in:
Michael Wolf
2025-11-17 10:58:54 -06:00
parent c346a70cce
commit 1a13fd0909
20 changed files with 2102 additions and 0 deletions

19
express/handlers.ts Normal file
View File

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