You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import {Injectable} from "@extollo/di";
|
|
|
|
import {AppClass} from "../../lifecycle/AppClass";
|
|
|
|
import {HTTPKernel} from "./HTTPKernel";
|
|
|
|
import {Request} from "../lifecycle/Request";
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class HTTPKernelModule extends AppClass {
|
|
|
|
public readonly executeWithBlockingWriteback: boolean = false
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the given module should be applied to the incoming request.
|
|
|
|
* @param {Request} request
|
|
|
|
* @return Promise<boolean>
|
|
|
|
*/
|
|
|
|
public async match(request: Request): Promise<boolean> {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Apply the module to the incoming request.
|
|
|
|
* @param {Request} request
|
|
|
|
* @return Promise<Request>
|
|
|
|
*/
|
|
|
|
public async apply(request: Request): Promise<Request> {
|
|
|
|
return request
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register this module with the given HTTP kernel.
|
|
|
|
* @param {HTTPKernel} kernel
|
|
|
|
*/
|
|
|
|
public static register(kernel: HTTPKernel) {
|
|
|
|
kernel.register(this).before()
|
|
|
|
}
|
|
|
|
}
|