file
HTTP (deprecated)
v7
Preview
1
2
3
4
5
6
import
{
fetch
}
from
"https://esm.town/v/std/fetch"
;
export
const
file
=
async
(
req
:
Request
)
:
Promise
<
Response
>
=>
new
Response
(
(
await
fetch
(
"file:"
+
new
URL
(
req
.
url
)
.
pathname
)
)
.
body
,
{
headers
:
{
"Content-Type"
:
"text/plain"
}
,
}
)
;
Preview