Readme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export const echo = (req: Request) => {
const searchParams = new URL(req.url).searchParams;
return Response.json({
"headers": Object.fromEntries(req.headers.entries()),
"url": req.url,
"method": req.method,
"mode": req.mode,
"cache": req.cache,
"credentials": req.credentials,
"body": req.body,
"destination": req.destination,
"integrity": req.integrity,
"referrer": req.referrer,
"redirect": req.redirect,
"searchParams": Object.fromEntries(searchParams.entries()),
"docs": "https://developer.mozilla.org/en-US/docs/Web/API/Request",
});
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.