deno.land / x / alosaur@v1.1.1 / examples / customdi / areas / home / home.controller.ts
12345678910111213141516import { ActionParam, Controller, Get, Inject, QueryParam } from "alosaur/mod.ts";import { FooService } from "../../services/foo.service.ts";
@Controller({ baseRoute: "/home", ctor: { inject: ["FooService"] } })export class HomeController { name: string | undefined = undefined;
constructor(private service: FooService) {}
@Get("/text") @ActionParam(0, QueryParam("name")) text(name: string) { return `Hey! ${this.service.getName()}, ${name}`; }}
Version Info