Skip to main content

Class: ApplicationRegistry

Defined in: src/Registry.ts:19

Constructors​

Constructor​

new ApplicationRegistry(options: RegistryOptions): Registry

Defined in: src/Registry.ts:25

Parameters​

ParameterType
optionsRegistryOptions

Returns​

Registry

Methods​

getEvents()​

getEvents(): Event[]

Defined in: src/Registry.ts:163

Function

Returns​

Event[]

Name​

getEvents()

Description​

Gets all the routes currently attached to the registry.


getMiddlewares()​

getMiddlewares(): Middleware[]

Defined in: src/Registry.ts:182

Function

Returns​

Middleware[]

Name​

getMiddlewares()

Description​

Gets all the middlewares currently attached to the registry.


getRoutes()​

getRoutes(): Route[]

Defined in: src/Registry.ts:141

Function

Returns​

Route[]

Name​

getRoutes()

Description​

Gets all the routes currently attached to the registry.


registerApplicationEvent()​

registerApplicationEvent(configureEvent: (event: ApplicationListener) => ApplicationListener): ApplicationListener

Defined in: src/Registry.ts:101

Function

Parameters​

ParameterTypeDescription
configureEvent(event: ApplicationListener) => ApplicationListener

Returns​

ApplicationListener

Name​

registerApplicationEvent()

Description​

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.

Example​

return registry.registerApplicationEvent((event) =>
event //
.setEventType(ApplicationEvent.READY)
.setHandler(this.run)
);
@function

registerApplicationMiddleware()​

registerApplicationMiddleware(configureMiddleware: (middleware: ApplicationMiddleware) => ApplicationMiddleware): ApplicationMiddleware

Defined in: src/Registry.ts:125

Function

Parameters​

ParameterTypeDescription
configureMiddleware(middleware: ApplicationMiddleware) => ApplicationMiddleware

Returns​

ApplicationMiddleware

Name​

registerApplicationMiddleware()

Description​

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.

Example​

return registry.registerApplicationMiddleware((middleware) =>
middleware //
.setMiddlewareName('middleware')
.setHandler(this.run)
.runOnAllRoutes(false)
);
@function

registerApplicationRoutes()​

registerApplicationRoutes(configureRoute: (route: ApplicationRoute) => ApplicationRoute): ApplicationRoute

Defined in: src/Registry.ts:80

Function

Parameters​

ParameterTypeDescription
configureRoute(route: ApplicationRoute) => ApplicationRoute

Returns​

ApplicationRoute

Name​

registerApplicationRoutes()

Description​

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.

Example​

return registry.registerApplicationRoutes((route) =>
route //
.setRouteName('')
.setMethod(Methods.GET)
);
@function