This is a pattern in which the module.exports
of the module you are requiring is set to a function. Requiring that module returns a function, and the parentheses after the require evaluates the function with an argument.
In your example above, your ./routes/index.js
file would look something like the following:
module.exports = function(app) {
app.get("https://stackoverflow.com/", function(req, res) {
});
// ...
};
This pattern is often used to pass variables to modules, as can bee seen above with the app
variable.