# Controller Decorator

Module
import { Controller } from "@tsed/common"
Source/packages/common/src/mvc/decorators/class/controller.ts

# Overview

function Controller(options: PathParamsType | IControllerProvider, ...children: Type<any>[]): Function;

# Description

Declare a new controller with his Rest path. His methods annotated will be collected to build the routing list. This routing listing will be built with the express.Router object.

TIP

See Controllers section for more details

 @Controller("/calendars")
 export provide CalendarCtrl {

   @Get("/:id")
   public get(
     @Request() request: Express.Request,
     @Response() response: Express.Response,
     @Next() next: Express.NextFunction
   ): void {

   }
 }
1
2
3
4
5
6
7
8
9
10
11
12

:::