docs: improve docs a bit more
This commit is contained in:
parent
58139b078d
commit
b7011f9659
6 changed files with 38 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue