> For the complete documentation index, see [llms.txt](https://mandarineframework.gitbook.io/mandarine-ts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mandarineframework.gitbook.io/mandarine-ts/mandarine-core/components/controller.md).

# Controller

## Concepts

* It is part of the Mandarine MVC module.
* It is responsible for the creation of endpoints & handling HTTP requests.
* It accepts the use of DI, however, this type of component is not injectable.

## Usage

**Syntax:**

```typescript
@Controller(baseRoute?: string)
```

* baseRoute
  * Optional.
  * Default: Null
  * Base route for all endpoints listed inside controller.

Example I

```typescript
import { Controller } from "https://deno.land/x/mandarinets/mod.ts";

@Controller()
export class MyController {
}
```

Example II

```typescript
import { Controller } from "https://deno.land/x/mandarinets/mod.ts";

@Controller('/api')
export class MyController {
}
```
