Skip to content

Commit

Permalink
Merge pull request #34 from dotarjun/fixes-issue-32
Browse files Browse the repository at this point in the history
docs: fix incorrect Controller and parameter decorators
  • Loading branch information
rsaz authored Oct 4, 2023
2 parents 6a30a64 + 19d75d4 commit 04c391c
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions docs/overview/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 04c391c

Please sign in to comment.