Skip to main content

Class: RouteFactory

Defined in: packages/core/src/router/RouteFactory.ts:9

Utility factory used by router to create routes.

Constructors​

Constructor​

new RouteFactory(): RouteFactory

Returns​

RouteFactory

Accessors​

$dependencies​

Get Signature​

get static $dependencies(): never[]

Defined in: packages/core/src/router/RouteFactory.ts:10

Returns​

never[]

Methods​

createRoute()​

createRoute(name, pathExpression, controller, view, options?): DynamicRoute | StaticRoute

Defined in: packages/core/src/router/RouteFactory.ts:32

Create new instance of ima.core.router.AbstractRoute.

Parameters​

name​

string

The unique name of this route, identifying it among the rest of the routes in the application.

pathExpression​

A path expression specifying either the URL path part matching this route (must not
contain a query string) with optionally containing named parameter placeholders specified as :parameterName. Or object defining matcher in form of regular expression and toPath and extractParameters function overrides.

string | RoutePathExpression

controller​

AsyncRouteController

The full name of Object Container alias identifying the controller associated with this route.

view​

AsyncRouteView

The full name or Object Container alias identifying the view class associated with this route.

options?​

Partial<RouteFactoryOptions>

The route additional options.

Returns​

DynamicRoute | StaticRoute

The constructed route.