Elysia¶
Use miki-template with Elysia (Bun-native framework) by calling asyncRender() in your handlers.
Setup¶
const { Elysia } = require('elysia');
const miki = require('miki-template');
const app = new Elysia();
app.get('/', async () => {
const html = await miki.asyncRender('index', {}, { views: './views' });
return new Response(html, {
headers: { 'Content-Type': 'text/html' }
});
});
module.exports = app;
Partial Rendering¶
Next Steps¶
- Integrations Overview
- [API Reference: asyncRender param($m) $m.Value -replace '([a-z][a-z0-9-]+).md , '../.md' -replace '([a-z][a-z0-9-]+) , '../.md'