Skip to main content

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: RegistryOptions

Returns

ApplicationRegistry

Defined in

registry/Registry.ts:32

Methods

flush()

flush(): void

Clear all registries.

Returns

void

Defined in

registry/Registry.ts:163


getEvents()

getEvents(): object[]

Gets all the routes currently attached to the registry.

Returns

object[]

Defined in

registry/Registry.ts:123


getMiddlewares()

getMiddlewares(): object[]

Gets all the middlewares currently attached to the registry.

Returns

object[]

Defined in

registry/Registry.ts:142


getRoutes()

getRoutes(): object[]

Gets all the routes currently attached to the registry.

Returns

object[]

Defined in

registry/Registry.ts:101


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

ApplicationListener

Example

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

Defined in

registry/Registry.ts:67


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

ApplicationMiddleware

Example

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

Defined in

registry/Registry.ts:88


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

ApplicationRoute

Example

return registry.registerApplicationRoutes((route) =>
route //
.setRouteName('')
.setMethod(Methods.GET)
.setHandler(this.run)
);

Defined in

registry/Registry.ts:49