UNPKG

@tsed/platform-koa

Version:
30 lines (29 loc) 621 B
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; } }