January 2020
Intermediate to advanced
548 pages
13h 36m
English
To illustrate the act of cargo culting, let's imagine that a programmer is tasked with adding a new HTTP GET route to their Node.js server. They need to add the /about_us route. They open up the routes.js file and, among its many lines, find the following code:
app.use('/admin', (req, res, next) => { const admin = await attemptLoadAdminSection(req, res); if (admin) { next(); } else { res.status(403).end('You are not authorized'); }});
This code happens to be using a Node.js framework: Express. Unfortunately, however, the programmer is not well versed in the Express API. They see the preceding code and seek to emulate it for their own ends:
app.use('/about_us', (req, res, next) => { attemptLoadAboutSection(req, res);Read now
Unlock full access