So far I've always been developing my clientside applications without any of my own servers running behind it, using Webstorm's built-in webserver to serve my content.
What I frequently see when people use Node with Express to act as their webserver is the debate on if you should put your html files with node or with the client code.
I understand javascript files that are included in html or css are best stored in the client directory?
So my first question is, with a folder structure like this
app/
client/ js files
server/ node files
Should you include your html pages in your server or your client directory?
Secondly:
Sometimes I see people use express.static
for static files, what exactly is implied by static files here? Today most websites are not static documents anymore but are files that get altered by javascript by manipulating the DOM, so I don't think any html files should be considered as static files?
As far as I can see, the only advantage I have with using Node instead of the built-in webserver is if I want to have database access.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…