Sunday, 26 November 2017

Would anyone mind looking at my server code?

Here's the code. Here's a picture of the file layout.I'm mostly interested in the errors I have probably made in /server/scripts/server.js. I guess my two primary concerns are:Only the public directory should ever be served.I'm not entirely sure about which headers to set. Do I Need to set Last-Modified and Cache-Control when serving a file for the first time? When I get any request with the If-Modified-Since header can I simply return 304 and be done with it? Are there any other headers I'm not handling right?But any additional corrections you have would be great. The UI is just there for something to look at. I haven't got past focusing on the server code yet.*I would prefer to roll my own server instead of using express. I know about express.

Submitted November 26, 2017 at 09:30PM by Nobody271

No comments:

Post a Comment