Class: ApplicationRegistry
Defined in: src/Registry.ts:19
Constructors
Constructor
new ApplicationRegistry(
options
:RegistryOptions
):Registry
Defined in: src/Registry.ts:25
Parameters
Parameter | Type |
---|---|
options | RegistryOptions |
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
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
Parameter | Type | Description |
---|---|---|
configureEvent | (event : ApplicationListener ) => ApplicationListener |
Returns
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
Parameter | Type | Description |
---|---|---|
configureMiddleware | (middleware : ApplicationMiddleware ) => ApplicationMiddleware |
Returns
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
Parameter | Type | Description |
---|---|---|
configureRoute | (route : ApplicationRoute ) => ApplicationRoute |
Returns
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