• Add a controller method to handle a PUT request.

    Returns MethodDecorator

    The new decorator function.

    Example

    // index.ts

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

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

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

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

    Returns MethodDecorator

  • Parameters

    • schema: AnySchema<any>
    • Optional limit: Nilable<number>

    Returns MethodDecorator

  • Returns MethodDecorator

  • Returns MethodDecorator

  • Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

  • Parameters

    • path: string

    Returns MethodDecorator

  • Parameters

    Returns MethodDecorator

  • Parameters

    • path: string
    • schema: Schema
    • Optional limit: Nilable<number>

    Returns MethodDecorator

Generated using TypeDoc