Add support for deepmatch routes
This commit is contained in:
@@ -13,6 +13,7 @@ import {Canonical} from './Canonical.ts'
|
||||
import {Logging} from '../service/logging/Logging.ts'
|
||||
import {Canon} from './Canon.ts'
|
||||
import {isBindable} from '../lifecycle/AppClass.ts'
|
||||
import {DeepmatchRoute} from "../http/routing/DeepmatchRoute.ts";
|
||||
|
||||
export type RouteHandler = (request: Request) => Request | Promise<Request> | ResponseFactory | Promise<ResponseFactory> | void | Promise<void>
|
||||
export type RouteHandlers = RouteHandler[]
|
||||
@@ -138,11 +139,11 @@ export default class Routing extends LifecycleUnit {
|
||||
public build_route(base: string): Route {
|
||||
if ( !base.includes(':') && !base.includes('*') ) {
|
||||
return new SimpleRoute(base)
|
||||
} else if ( base.includes('**') ) {
|
||||
return new DeepmatchRoute(base)
|
||||
} else {
|
||||
return new ComplexRoute(base)
|
||||
}
|
||||
|
||||
// TODO deep-match route
|
||||
}
|
||||
|
||||
public match(incoming: string): Route | undefined {
|
||||
|
||||
Reference in New Issue
Block a user