deno.land / x / alosaur@v1.1.1 / examples / customdi / areas / home / home.controller.ts

home.controller.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { 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}`; }}
alosaur

Version Info

Tagged at
a year ago