Controller
Decorator that marks a class as a Nest controller that can receive inbound requests and produce responses.
@Controller(prefixOrOptions?: string | string[] | ControllerOptions)
Parameters
Option | Type | Description |
---|---|---|
prefixOrOptions
|
string | string[] | ControllerOptions |
a
|
Returns
ClassDecorator
See also
Description
An HTTP Controller responds to inbound HTTP Requests and produces HTTP Responses.
It defines a class that provides the context for one or more related route
handlers that correspond to HTTP request methods and associated routes
for example GET /api/profile
, POST /users/resume
A Microservice Controller responds to requests as well as events, running over a variety of transports (read more here). It defines a class that provides a context for one or more message or event handlers.