Controller

This page summarizes the information & use of the controller component.

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:

@Controller(baseRoute?: string)
  • baseRoute

    • Optional.

    • Default: Null

    • Base route for all endpoints listed inside controller.

Example I

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

@Controller()
export class MyController {
}

Example II

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

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

Last updated