

Lesson 07 · 11 min
An HTTP server without a framework
Express is just a wrapper. Underneath is the node:http module.
11 minLesson 7 of 10Practice includedAsk AI on any point
http.createServer takes a function that Node calls on every request. req has the method, address, and headers, and the body arrives as a stream of chunks. With res you set the status and headers (writeHead) and finish the response (end). Routing, JSON parsing, and errors are up to you here — that's exactly what frameworks take on.
Sign in to continue
The rest of this lesson opens after sign up
The first lesson of every course is open without an account. To read on, solve the practice and use Ask, create a free account or log in.