Type Alias: ExpressHookContext
ExpressHookContext =
object
What the before hook of expressHTTPEntrypoint receives besides the express application: the entrypoint's module, the HTTP server (not listening yet) and the routes the actions will occupy.
Properties
actionPrefixes
readonlyactionPrefixes:string[]
The first segment of each action route ('/device', '/user'…). A route starting with a parameter (/:id) adds none.
isActionPath
readonlyisActionPath: (requestPath) =>boolean
Tell whether a request path belongs to the actions: it equals one of the action prefixes or starts with one followed by /.
Parameters
requestPath
string
Returns
boolean
module
readonlymodule:Module
The module owning the entrypoint, to get the application's objects from (await module.getObject('db')).
routes
readonlyroutes:Map<string,Set<string>>
Each action route mapped to its HTTP methods, as declared ('/users/:id' → {'get', 'delete'}).
server
readonlyserver:Server
The HTTP server serving the express application. It does not listen yet when the hook runs; attach other servers to it there (such as a socket.io server, see the server option of socketIOServiceEntrypoint).