Hacker News new | past | comments | ask | show | jobs | submit login

Yep, you shouldn't be using node to serve static files anyway. This is something a reverse proxy such as nginx should do. Node can then be used to serve either as a pure API (serving json with express is the easiest way) for a webapp or render the webpages.



nginx is not a bad choice, but would instead recommend node-http-proxy for most projects (including production).

It's fast, easy to setup (npm install), and relatively hardened, while still keeping everything JS.

As for static assets, those should probably be served from a CDN anyway, if one is concerned with performance.


I agree about the CDN, even though for us performance is not so critical we need to use a CDN (yet). I didn't know node-http-proxy but it sounds interesting I'll check it out.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: