Having a question regarding the performance of a NodeJS application. When I have the following express app in NodeJS:
const app = require('express')(); const about = require('./about'); app.use('/about', about); app.listen(3000, () => console.log('Example app listening on port 3000!')); My current understanding is that only when the server is started up it does need to require() these files using commonJS modules.
Question:
Does the express application has to execute the require() statements with every request to the server or is this only necessary when starting the server?
Any extra information about how express works under the hood would be nice.