Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/alosaur/docs/README.md

Alosaur - Deno web framework with many decorators
Very Popular
Go to Latest
File

Documentations

Application examples

Simple example:

import { Controller, Get, Area, App } from 'https://deno.land/x/alosaur/src/mod.ts'

@Controller('/home')
export class HomeController {
  @Get('/text')
  text() {
    return "Hello world";
  }
  @Get('/json')
  json() {
    return {"text":"test"};
  }
}
@Area({
  controllers: [HomeController]
})
export class HomeArea {
}
const app = new App({
  areas: [HomeArea]
});

app.listen();
  import { Cookie, setCookie, getCookies, delCookie } from "https://deno.land/std/http/cookie.ts";

  ...
  @Get('/view')
  view(Req() request: ServerRequest, @Res() response: Response) {
    const cookies = getCookies(request);
    
    const cookie: Cookie = { name: "Space", value: "Cat" };
    setCookie(response, cookie);

    delCookie(response, "deno");

    return View(result);
  }