April 2018
Intermediate to advanced
178 pages
3h 51m
English
What we have developed so far is a simple HTTP server application that listens and processes known request types; however, it is not so well structured, as the functions handling the requests are not reusable. Node.js supports modules embracing code isolation and reusability.
We will rework our HTTP server application in such a way that the entire request handling functionality will be wrapped in a module. The module will export only a generic handler function that will take a request object as argument and, based on its ...