

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Web Servers
incomplete
2: Async TypeScript
incomplete
3: Setup
incomplete
4: Build
incomplete
5: Server
incomplete
6: Fileservers
incomplete
7: Fileserver Quiz
incomplete
8: Serving Images
incomplete
9: Workflow Tips
incomplete
10: Custom Handlers
incomplete
11: Request, Response
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
All handlers in express take a Request and a Response.
The Request argument is fairly obvious: it contains all the information about the incoming request, such as the HTTP method, path, headers, and body.
The Response is less intuitive in my opinion. The response is an argument, not a return type. Instead of returning a value all at once from the handler function, we write the response to the Response object.