@tsed/platform-koa
Version:
Koa package for Ts.ED framework
30 lines (29 loc) • 621 B
JavaScript
import "@koa/router";
import { PlatformRequest } from "@tsed/platform-http";
/**
* @platform
* @koa
*/
export class PlatformKoaRequest extends PlatformRequest {
get ctx() {
return this.$ctx.event.koaContext;
}
get protocol() {
return this.ctx.request.protocol;
}
get host() {
return this.ctx.request.host;
}
get secure() {
return this.ctx.request.secure;
}
get cookies() {
return this.ctx.cookie || this.ctx.cookies;
}
get session() {
return this.ctx.session;
}
getReq() {
return this.ctx.request.req;
}
}