Simple question. In an Express app, when looking to serve files under a certain root directory, theres the express.static middleware like so:
app.use(base, express.static(root));
But it looks like the same thing can be done by just using response.sendFile like so:
app.use(base, (req, res) => res.sendFile(req.path, { root: root }));
What the advantage of one over the other, and when would I use each?