A
A
Alexey Segodin2021-04-01 16:36:53
Node.js
Alexey Segodin, 2021-04-01 16:36:53

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

6065ca569634f393294336.png

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

1 answer(s)
L
Lynn "Coffee Man", 2021-04-01
@Aleksei_Segodin

Rearrange
app.use(express.static(path.join(__dirname, 'public')));
before
app.use(logger);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question