I have the code below and it works, i.e. I first get the index.html page and then I successfully load the stylesheet with the app.use.
My understanding was that the incoming request is matched with all methods and a response is sent when there is a successful match.
In that case the response must be sent when the app.get() gets executed. How then, after sending the response, is the app getting to the app.use() and applying the styles to the index.html (that should have already been sent as a response).
app.get('/', (req, res) => {
res.sendFile(__dirname + '/views/index.html');
});
app.use(express.static(__dirname + '/public'))