• Imports the request context into an argument / parameter of a handler.

    Returns ParameterDecorator

    The new decorator function.

    Example

    // index.ts

    import { Controller, ControllerBase, GET, IHttpRequest, IHttpResponse, Parameter, Request, Response } from '@egomobile/http-server'

    @Controller()
    export default class IndexController extends ControllerBase {
    @GET('/foo/:bar/buzz')
    async getBar(
    @Parameter() bar: string,
    @Request() request: IHttpRequest, @Response() response: IHttpResponse
    ) {
    response.write('bar: ' + bar)
    }
    }

Generated using TypeDoc