Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
// We will create an HTTP val that responds with "Hello world" on every request.
// We will use Deno's built-in HTTP module to create the server and handle incoming requests.
// Define the main function that will handle HTTP requests
export default async function main(_req: Request) {
// Return a simple Response with "Hello world"
return new Response("Hello world");
}