1import { serve } from "@std/http";23const handler = (request: Request): Response => {4 const url = new URL(request.url);56 if (url.pathname === "/") {7 return new Response("Welcome to the API", {8 headers: { "Content-Type": "text/plain" },9 });10 }1112 if (url.pathname === "/api/hello") {13 return Response.json({ message: "Hello from Deno" });14 }1516 return new Response("Not Found", { status: 404 });17};1819console.log("Server running at http://localhost:8000");20serve(handler, { port: 8000 });