The Problem: Pretty straightforward - I am simply trying to do my work on localhost, but for some reason any time I make a change to an HTML file it does not update the corresponding view. If I want the change to be updated I have to restart the web server (using node) every time.
The tech I'm using:
What I have tried: Began with small things and tried working my way out
$nodemon server.js
. So just to test it out, I then ran it just using: node server.js
. Didn't work. I then read a post, here: localhost stopped updating - python. I thought maybe node/nodemon had a process running from the night before (my computer restarted on it's own) and I just couldn't find the right process to kill. Tried searching for it:
$netstat -ano | find "LISTENING" | find "8080"
. It returned nothing. So just to be on the save side I typed in: taskkill /f /im node.exe
. Didn't work.Lastly, as I stated in attempt #3, my computer restarted last night on it's own which is what I believe is causing this issue, I then looked to kill any processes related to MS Visual Studio. My thoughts being I'm getting desperate for an answer. Didn't work.
Forgot to mention - Yes, I tried checking for changes on Firefox and MS Edge and no it doesn't update on those browsers either.
This problem is very basic, I think. However, I do not see why it is occurring; I have never ran into something like this. Thoughts/ideas/potential solutions will be greatly appreciated as well! I don't want to have to restart the server every single time to check on my changes.
Also not sure what tags to even put, so feel free!
EDIT: I tested the same issue with another project and it worked fine. As in, I ran $nodemon server.js
and made changes to the home page of a separate project and the HTML was updated without having to restart the server.
Well it turns out I found the solution thanks to this stackoverflow solution. In my server.js file I have set template caching. So I commented out the line app.enable('view cache');