DavidWells / isomorphic-react-example

Deprecated! ReactJS + NodeJS ( express ) demo tutorial with video. Universal/Isomorphic JS = Shared JavaScript that runs on both the client & server.
http://davidwells.io
MIT License
1.69k stars 272 forks source link

Question: Why is it advised not to include static assets in production? #8

Closed adam-beck closed 9 years ago

adam-beck commented 9 years ago

For the server there is this block of code

// Include static assets. Not advised for production
app.use(express.static(path.join(__dirname, 'public')));

and I was just wondering why it isn't advised to include the static assets for production.

DavidWells commented 9 years ago

Node isn't particularly meant for serving up static files, but it can.

It's advised to offload and serve static assets from something like nginx or a CDN.