Class HttpControllerDecorator

Hierarchy

  • HttpControllerDecorator

Constructors

Properties

Methods

  • Parameters

    • Rest ...middlewares: HttpActionMiddleware[]

    Returns void

  • Adds a parameter resolver for parameters based on the class type. Use .resolveParameterByName() for name-based resolving.


    class UserResolver {
    resolve(context: RouteParameterResolverContext): any | Promise<any> {
    return new User();
    }
    }

    @http.resolveParameter(User, UserResolver)
    class MyController {

    @http.GET()
    myAction(user: User) {
    }
    }

    new App({providers: [UserResolver]}).run();

    Parameters

    Returns void

  • Adds a parameter resolver for parameters based on its name. Use .resolveParameter() for class-based resolving.


    class UserResolver {
    resolve(context: RouteParameterResolverContext): any | Promise<any> {
    return new User();
    }
    }

    @http.resolveParameterByName('user', UserResolver)
    class MyController {

    @http.GET()
    myAction(user: User) {
    }
    }

    new App({providers: [UserResolver]}).run();

    Parameters

    Returns void

Generated using TypeDoc