Answer the question
In order to leave comments, you need to log in
How to stop serving static files via Node.JS on local server?
When I load the site page on the local server, the call to all static files is displayed in the console, like this:
It
interferes with working when there are a lot of such files, and I want to track my commands console.log();
?
I know how to do it in Nginx so that it gives static files instead of Node.JS. But how do you do it on a local server on Windows or macOS?
Answer the question
In order to leave comments, you need to log in
Rearrange
app.use(express.static(path.join(__dirname, 'public')));
before
app.use(logger);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question