• Add a controller method to handle a TRACE request.

    Returns MethodDecorator

    The new decorator function.

    Example

    // index.ts

    import { Controller, ControllerBase, IHttpRequest, IHttpResponse, TRACE } from '@egomobile/http-server'

    @Controller()
    export default class IndexController extends ControllerBase {
    // can be accessed with a TRACE request
    // by using route /
    @TRACE()
    async index(request: IHttpRequest, response: IHttpResponse) {
    response.write('(root): ' + new Date())
    }

    // can be accessed with a TRACE request
    // by using route /foo
    @TRACE()
    async foo(request: IHttpRequest, response: IHttpResponse) {
    response.write('foo: ' + new Date())
    }

    // can be accessed with a TRACE request
    // by using route /baz
    @TRACE('/baz')
    async bar(request: IHttpRequest, response: IHttpResponse) {
    response.write('baz: ' + new Date())
    }
    }
  • Parameters

    Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

Generated using TypeDoc