• Add a controller method to handle a DELETE request.

    Returns MethodDecorator

    The new decorator function.

    Example

    // index.ts

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

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

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

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

    Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

Generated using TypeDoc