Type Alias: FastifyHookContext
FastifyHookContext =
object
What the before hook of fastifyHTTPEntrypoint receives besides the fastify instance: 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, in upper case ('/users/:id' → {'GET', 'DELETE'}).
server
readonlyserver:Server
The HTTP server of the fastify instance. 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).