Jiew Meng
Jiew Meng

Reputation: 88337

Static Content & NodeJS

I saw many articles showing how NodeJS can serve static content, like this, basically, they use Node to read the file and return the result. I don't think thats the right way? It seems inefficient? Also how do I detect the right content type (CSS, JS etc)? Is there a proper way of doing this?

Upvotes: 1

Views: 1335

Answers (1)

JohnnyHK
JohnnyHK

Reputation: 312105

The standard way of doing this is to use one of the node modules that already exist for static file serving such as Connect or node-static.

Upvotes: 4

Related Questions