Skip to content

Instantly share code, notes, and snippets.

@omirobarcelo
Created June 9, 2020 16:05
Show Gist options
  • Save omirobarcelo/bfda9c3ffb8afe40397d7adfdf2b8970 to your computer and use it in GitHub Desktop.
Save omirobarcelo/bfda9c3ffb8afe40397d7adfdf2b8970 to your computer and use it in GitHub Desktop.
Hello World Alosaur application
import { Controller, Get, Area, App } from 'https://deno.land/x/alosaur/mod.ts';
@Controller('/home')
export class HomeController {
@Get('/text')
text() {
return 'Hello world';
}
@Get('/json')
json() {
return { text: 'test' };
}
}
// Declare module
@Area({
controllers: [HomeController],
})
export class HomeArea {}
// Create alosaur application
const app = new App({
areas: [HomeArea],
});
const PORT = Deno.env.get('PORT') || '8000';
app.listen(`:${PORT}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment