webHTMLExample
HTTP (deprecated)
v4
Preview
1
2
3
4
5
6
7
8
// View at https://neverstew-webHTMLExample.web.val.run?name=Steve
export
async
function
webHTMLExample
(
req
:
Request
)
{
const
query
=
new
URL
(
req
.
url
)
.
searchParams
;
return
new
Response
(
`<h1>Hi
${
query
.
get
(
"name"
)
||
(
await
req
.
json
(
)
)
.
name
}
!</h1>`
,
{
headers
:
{
"Content-Type"
:
"text/html"
}
}
,
)
;
}
Preview