diff --git a/docs/overview/controller.md b/docs/overview/controller.md index 82626b6f..2af5233e 100644 --- a/docs/overview/controller.md +++ b/docs/overview/controller.md @@ -140,30 +140,30 @@ HTTP methods and parameters decorators are a set of annotations used in Expresso Here's a list of all available `@httpMethods()` decorators in ExpressoTS, along with their description and usage: -| Decorator | Description | Usage | -| ----------- | -------------------------------------------------- | ---------------------------- | -| @httpGet | Binds a controller method to a GET HTTP verb. | @httpGet("/path") | -| @httpPost | Binds a controller method to a POST HTTP verb. | @httpPost("/path") | -| @httpPut | Binds a controller method to a PUT HTTP verb. | @httpPut("/path") | -| @httpPatch | Binds a controller method to a PATCH HTTP verb. | @httpPatch("/path") | -| @httpHead | Binds a controller method to a HEAD HTTP verb. | @httpHead("/path") | -| @httpDelete | Binds a controller method to a DELETE HTTP verb. | @httpDelete("/path") | -| @httpMethod | Binds a controller method to a specified HTTP verb.| @httpMethod("verb", "/path") | +| Decorator | Description | Usage | +| --------- | --------------------------------------------------- | ------------------------ | +| @Get | Binds a controller method to a GET HTTP verb. | @Get("/path") | +| @Post | Binds a controller method to a POST HTTP verb. | @Post("/path") | +| @Put | Binds a controller method to a PUT HTTP verb. | @Put("/path") | +| @Patch | Binds a controller method to a PATCH HTTP verb. | @Patch("/path") | +| @Head | Binds a controller method to a HEAD HTTP verb. | @Head("/path") | +| @Delete | Binds a controller method to a DELETE HTTP verb. | @Delete("/path") | +| @Method | Binds a controller method to a specified HTTP verb. | @Method("verb", "/path") | ### Parameter Decorators Here's a list of all available parameter decorators in ExpressoTS, along with their description and usage: -| Decorator | Description | Usage -| ------------------------------------ | ------------------------------------------------------ | -------------------------------------------------------- | -| @request() | Injects the Express Request object. | execute(@request() req: Request) -| @response() | Injects the Express Response object. | execute(@response() res: Response) -| @requestParam(paramName?: string) | Injects a parameter from the request URL path. | execute(@requestParam('id') id: string) -| @queryParam(paramName?: string) | Injects a parameter from the request URL query string. | execute(@queryParam('searchTerm') searchTerm: string) -| @requestBody() | Injects the request body payload. | execute(@requestBody() body: MyDTO) -| @requestHeaders(headerName?: string) | Injects a header from the request headers. | execute(@requestHeaders('authorization') auth: string) -| @cookies(cookieName?: string) | Injects a cookie from the request cookies. | execute(@cookies('session') session: string) -| @next() | Injects the Express NextFunction object. | execute(@next() next: NextFunction) +| Decorator | Description | Usage | +| ----------------------------- | ------------------------------------------------------ | ------------------------------------------------ | +| @request() | Injects the Express Request object. | execute(@request() req: Request) | +| @response() | Injects the Express Response object. | execute(@response() res: Response) | +| @param(paramName?: string) | Injects a parameter from the request URL path. | execute(@param('id') id: string) | +| @query(paramName?: string) | Injects a parameter from the request URL query string. | execute(@query('searchTerm') searchTerm: string) | +| @body() | Injects the request body payload. | execute(@body() body: MyDTO) | +| @headers(headerName?: string) | Injects a header from the request headers. | execute(@headers('authorization') auth: string) | +| @cookies(cookieName?: string) | Injects a cookie from the request cookies. | execute(@cookies('session') session: string) | +| @next() | Injects the Express NextFunction object. | execute(@next() next: NextFunction) | ## An MVC Approach