@elysia/html (英语)
爱莉西亚 将 Plugin 转换为 HTML .
安装
bun add @elysia/html
示例
import { Elysia } from 'elysia'
// 'Html' is required for JSX support but not required for string HTML
import { html, Html } from '@elysia/html'
new Elysia()
.use(html())
.get(
'/html',
() => `
<html lang='en'>
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>`
)
.get('/jsx', () => (
<html lang="en">
<head>
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
))
.listen(3000)
见 文档 更多细节.