Named routes & basic login framework

This commit is contained in:
2021-07-17 12:49:07 -05:00
parent e33d8dee8f
commit e86cf420df
26 changed files with 412 additions and 77 deletions

View File

@@ -215,6 +215,9 @@ export class Route extends AppClass {
/** Pre-compiled route handler for the main route handler for this route. */
protected compiledPostflight?: ResolvedRouteHandler[]
/** Programmatic aliases of this route. */
public aliases: string[] = []
constructor(
/** The HTTP method(s) that this route listens on. */
protected method: HTTPMethod | HTTPMethod[],
@@ -228,6 +231,15 @@ export class Route extends AppClass {
super()
}
/**
* Set a programmatic name for this route.
* @param name
*/
public alias(name: string): this {
this.aliases.push(name)
return this
}
/**
* Get the string-form of the route.
*/