Alosaur - Deno web framework 🦖.
microsoft/TSyringe (more about alosaur injection)Controller:
import {
Controller,
Content,
Get,
Area,
App,
} from 'https://deno.land/x/alosaur/src/mod.ts'
@Controller('/home')
export class HomeController {
@Get('/text')
text() {
return Content("Hello world");
}
@Get('/json')
json() {
return Content({"text":"test"});
}
}
// Declare module
@Area({
controllers: [HomeController]
})
export class HomeArea {
}
// Create alosaur application
const app = new App({
areas: [HomeArea]
});
app.listen();
tsconfig.app.json:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}
And run
deno run -A --config ./src/tsconfig.app.json app.ts
Add render views: dejs
Add decorators:
@Param param from url: @Middleware@CacheAdd CI with minimal tests. (see this comment
Add validators example class-validator