Classes
Members
routes :Map.<string, {pattern: string, matcher: RegExp, methods: Map.<string, object>}>
Type:
- Map.<string, {pattern: string, matcher: RegExp, methods: Map.<string, object>}>
Methods
allowedMethods(pathname) → {Array.<string>|null}
List the methods allowed on a concrete path.
OPTIONS is always allowed, and HEAD is allowed wherever GET is.
Parameters:
| Name | Type | Description |
|---|---|---|
pathname |
string | Request path |
Returns:
Allowed methods, or null when the path is unowned
- Type
- Array.<string> | null
describe() → {Array.<{path: string, methods: Array.<string>, summary: string}>}
Render the registry as the routes member of a service description.
Returns:
Route descriptions
- Type
- Array.<{path: string, methods: Array.<string>, summary: string}>
find(pathname) → {object|undefined}
Find the route entry owning a concrete path.
Parameters:
| Name | Type | Description |
|---|---|---|
pathname |
string | Request path |
Returns:
Route entry, or undefined when unowned
- Type
- object | undefined
register(method, pattern, metaopt) → {void}
Register a method on a path.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
method |
string | HTTP method |
|
pattern |
string | Path pattern |
|
meta |
object |
<optional> |
Description metadata for ยง9 |
Returns:
- Type
- void