Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Bun) expand_more
Bun / HTTP & Web APIs

Request routing

Learn Request routing in Bun with a focused explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Intermediate
bun-042.ts
ts
Bun.serve({fetch(req){const p=new URL(req.url).pathname; return p==="/health"?Response.json({ok:true}):new Response("Not found",{status:404});}});
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content