Type Alias: HTTPEntrypoint
HTTPEntrypoint = (
module,routeMap,handler,registerDestroy) =>unknown
An HTTP entrypoint in the style of lakutata 2.x: a function the entrypoint calls once when it starts (initialized: the objects it gets, such as an authenticator of the requests, may inject the entrypoint), which starts a server and passes its requests to the handler. A promise it returns is awaited, its rejection fails the entrypoint's startup (2.x did not await it). Prefer an adapter (expressHTTPEntrypoint of lakutata/adapter/express, fastifyHTTPEntrypoint of lakutata/adapter/fastify) for new code.
Parameters
module
The module owning the entrypoint (the application).
routeMap
The HTTP actions' routes, each with its methods.
handler
Runs a request: dispatches an HTTPContext to the matching action.
registerDestroy
Registers a function run when the entrypoint stops (closing the server).
Returns
unknown