Why Can't My Function Just Return the Request Body? (Node Backend Series, Part 5)
rge
0:00 / 0:00
Why Can't My Function Just Return the Request Body? (Node Backend Series, Part 5)
17 просмотров · 2 дн. назад
rge
50 подписчиков
17 просмотров · 2 дн. назад
Moving request-body parsing out of a route and into its own function should be a simple cleanup. Instead, the function returns undefined. This episode numbers each step to see what actually runs when, finds that the function finishes before the data has even arrived, and fixes it with a callback, the same pattern Node's own createServer has been using all along. No framework, just Node's built-in http module. Part of a series building a real backend in Node from scratch.
Playlist:
• Let's Build a Real Server From Scratch (No...