responses
Script
v5
Fork
1
2
3
4
5
6
7
8
9
10
import
{
render
}
from
"npm:preact-render-to-string"
;
export
const
htmlResponse
=
(
html
)
=>
new
Response
(
html
,
{
headers
:
{
"Content-Type"
:
"text/html"
,
}
,
}
)
;
export
const
reactResponse
=
(
component
)
=>
htmlResponse
(
render
(
component
)
)
;