Answer the question
In order to leave comments, you need to log in
The controller works 5 times. Why? How can you track it?
On an MVC project. There is a route -
controllers.setCity - a controller whose code is fully commented out except for console.log() .
And so this broad gull fulfills 5 times. I thought that some other routes lead to this controller - nope. If you do it , then the console will not work even once, i.e. there are no other calls to this controller.
I don’t ask what I should do, because I understand that it’s hard to help) Maybe someone knows how to track calls / executions? The debugger in WebStorm only monitors everything on the client, or I'm doing something wrong. app.use('/', controllers.setCity);
//app.use('/', controllers.setCity);
Answer the question
In order to leave comments, you need to log in
And what do you give by url? It seems to me that favicon is to blame here, statics like css, js ...
Make the output of urls from the request in console.log
The webstorm debugger can debug Node applications, just do it carefully according to the documentation. app.use
-- it will not be a controller, but a middleware (I know what you wanted to do app.get
). True, it should not be called 5 times anyway, so you need to dig into the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question