Class: ApplicationRegistry
The Registry class, this allows the Jova Server to register, use and manage its content.
Registry
Constructors
new ApplicationRegistry()
new ApplicationRegistry(
options
):ApplicationRegistry
Creates Registry a instance.
Parameters
• options
• options.basePath?: string
Returns
Defined in
Methods
flush()
flush():
void
Clear all registries.
Returns
void
Defined in
getEvents()
getEvents():
object
[]
Gets all the routes currently attached to the registry.
Returns
object
[]
Defined in
getMiddlewares()
getMiddlewares():
object
[]
Gets all the middlewares currently attached to the registry.
Returns
object
[]
Defined in
getRoutes()
getRoutes():
object
[]
Gets all the routes currently attached to the registry.
Returns
object
[]
Defined in
registerApplicationEvent()
registerApplicationEvent(
configureEvent
):ApplicationListener
Register an app event to the registry, does not work if the Jova App has already been initialised, but will work if the app has not.
Parameters
• configureEvent
Returns
Example
return registry.registerApplicationEvent((event) =>
event //
.setEventType(ApplicationEvent.READY)
.setHandler(this.run)
);
Defined in
registerApplicationMiddleware()
registerApplicationMiddleware(
configureMiddleware
):ApplicationMiddleware
Register an app middleware to the registry, does not work if the Jova App has already been initialised, but will work if the app has not.
Parameters
• configureMiddleware
Returns
Example
return registry.registerApplicationMiddleware((middleware) =>
middleware //
.setMiddlewareName('middleware')
.setHandler(this.run)
.runOnAllRoutes(false)
);
Defined in
registerApplicationRoutes()
registerApplicationRoutes(
configureRoute
):ApplicationRoute
Register an app route to the registry, does not work if the Jova App has already been initialised, but will work if the app has not.
Parameters
• configureRoute
Returns
Example
return registry.registerApplicationRoutes((route) =>
route //
.setRouteName('')
.setMethod(Methods.GET)
.setHandler(this.run)
);