Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PathRouteOptions<TContext>

An options for a route

Type parameters

  • TContext: Empty

    pass the request properties that the listener requires. Usually added by the middlewares

Hierarchy

  • PathRouteOptions

Index

Properties

listener: HttpListener<TContext & RouteContext>

Would pass the captured path parameters to the path property

method?: string

The http method to match. If omitted will match any method.

path: string | RegExp

If a pathname has a {some_name} in it it would be captured and accessible with the path paramters. You can have multiple parameters in the path, all of them will be extracted.

You match pathnames with regex. They need to start it with a ^ and should end it with $ Though that is not required and you can leave it out to create wildcard routes.

Generated using TypeDoc