I had an interesting issue today with Express today. I set up static files like I usually do, but intermittently I had an issue where some of the static resources (javascript files, in particular, would not load).

It turns out it was some of the other middleware slowing down the static file middleware. All I had to do was move the static file middleware higher up the stack. In fact, I added it immediately after declaring the Express application.

That solved the issue. Hopefully, this helps someone.

jjkennedy

View all posts

Add comment

Your email address will not be published. Required fields are marked *