feat(new): multi-runtime starter (node/deno/bun) via --runtime, shared + overlay templates
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
1 parent
c63c121787
commit
e8cd20b7ec
20 files changed
+173
-16
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { Route, Get, Html, Sse } from '@green-tea/core';
|
||||
|
||||
const ZEN = [
|
||||
'Simplicity is the ultimate sophistication.',
|
||||
'The obstacle is the path.',
|
||||
'When you let go, you have two hands to work.',
|
||||
'Make it work, make it right, make it fast.',
|
||||
'Less, but better.',
|
||||
];
|
||||
|
||||
@Route('/')
|
||||
export class HomeController {
|
||||
@Get('/')
|
||||
@Html('public/index.html')
|
||||
home() {}
|
||||
|
||||
@Sse('/zen')
|
||||
zen() {
|
||||
return (async function* () {
|
||||
for (let i = 0; ; i++) {
|
||||
yield { zen: ZEN[i % ZEN.length] };
|
||||
await new Promise((r) => setTimeout(r, 30_000));
|
||||
}
|
||||
})();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user