Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / GroupOptions

Interface: GroupOptions

Defined in: router/Router.ts:100

Options for Router.group(). All fields are optional.

Properties

prefix?

optional prefix?: string

Defined in: router/Router.ts:102

URL prefix applied to every route registered inside the group.


middleware?

optional middleware?: string | string[] | MiddlewareClass | MiddlewareClass[]

Defined in: router/Router.ts:111

Middleware to prepend to every route inside the group. Accepts a named group (string), an array of names/classes, or middleware class(es) directly.

Example

Router.group({ middleware: 'api' }, () => { ... });
Router.group({ middleware: ['web', AuthMiddleware] }, () => { ... });

domain?

optional domain?: string

Defined in: router/Router.ts:113

Host pattern; routes inside the group only match this host (e.g. ':tenant.app.com').