1
2
3
4
5
6
7
8
9
10
11
12
13
14
// The simplest approach to fulfill this request is to create an HTTP handler that responds to all requests with "Hello world" using the built-in Response class in TypeScript.
/**
* HTTP Val: Hello World Example
*
* This script will respond with "Hello world" to any incoming HTTP request.
*/
export default async function(req: Request): Promise<Response> {
return new Response("Hello world", {
headers: { "Content-Type": "text/plain" },
});
}