49688 (4) [Avatar] Offline
#1
In Listing 2.6, the argument to "http.createServer(...)" checks the value of "req.url":
http.createServer((req, res) => {
    if (req.url == '/') {
        fs.readFile...
    }
}).listen(8000, '127.0.0.1');

but the refactored version in in Listing 2.7 omits that check:
http.createServer((req, res) => {
    getTitles(res);
}).listen(8000, '127.0.0.1');

Is that change intended, given that it is not described in the text?