docs: improve docs a bit more

This commit is contained in:
Andy Burke 2025-06-19 15:55:35 -07:00
parent 58139b078d
commit b7011f9659
6 changed files with 38 additions and 1 deletions

View file

@ -1,12 +1,21 @@
/**
* SERVERUS SERVER module
* @module
*/
import * as colors from '@std/fmt/colors';
import * as fs from '@std/fs';
import * as path from '@std/path';
const DEFAULT_HANDLER_DIRECTORIES = [path.resolve(path.join(path.dirname(path.fromFileUrl(import.meta.url)), 'handlers'))];
/** A `HANDLER` must take a `Request` and return a `Response` if it can handle it. */
type HANDLER = (request: Request) => Promise<Response | null | undefined> | Response | null | undefined;
/** A `LOGGER` must take a `Request`, a `Response`, and a `processing_time` and log it. */
type LOGGER = (request: Request, response: Response, processing_time: number) => void | Promise<void>;
/** A `HANDLER_MODULE` must export a default method and may export an unload method to be called at shutdown. */
interface HANDLER_MODULE {
default: HANDLER;
unload?: () => void;