deno.land / x / alosaur@v1.1.1 / examples / cache / areas / core.area.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Area, Controller, Get } from "alosaur/mod.ts";import { ResponseCache } from "alosaur/src/hooks/response-cache/mod.ts";import { delay } from "../../_utils/test.utils.ts";
@Controller()export class CoreController { @Get() @ResponseCache({ duration: 2000 }) async text() { // long task await delay(200); return "Hello world"; }
@Get("/3000") @ResponseCache({ duration: 3000 }) async text300() { // long task await delay(400); return { text: "Hello world" }; }}
@Area({ controllers: [CoreController],})export class CoreArea {}
alosaur

Version Info

Tagged at
a year ago