Build a blazing fast API with Bun in 8 minutes | Beginner's Guide to Bun #2

Опубликовано: 17 Июнь 2026
на канале: average:dev
275
10

Hey everyone, I'm Average. In this episode of "Beginner's Guide to Bun" we check out Bun's HTTP server, Bun.serve.

While simple with its syntax, Bun.serve is extremely versatile, effectively replacing ExpressJS. As well as all of the useful elements of Bun.serve, I showcase Bun-native hot reloading, replacing another popular service, nodemon.

Thanks for watching!

Bun.serve() docs: https://bun.com/docs/runtime/http/server
Bun.serve() Routing docs: https://bun.com/docs/runtime/http/rou...
Bun Website: https://bun.com

[00:00] Intro
[00:18] Creating an HTTP Server with Bun.serve
[01:03] Using bun --watch for Hot Reloading
[01:27] Returning JSON and Setting Status Codes
[01:57] bun --watch recap, replacement for nodemon
[02:10] Bun.serve() endpoint routing
[02:50] 404 Not Found Fallback with fetch callback
[03:18] Advanced Routing with Methods (GET, POST)
[04:14] Working with Dynamic Path Parameters
[04:49] Static vs. Dynamic Routes: Performance Tips
[05:19] Serving a static HTML file with Bun.file
[05:55] Easy redirect headers
[06:15] Serving images or other files with Bun.file
[06:48] Accessing Request Headers
[07:05] Server Object
[07:25] Outro and What's Next