Why is it not recommended to serve static files from Node.js?View other answers to this thread
3.4K+ developers have started their personal blogs on Hashnode in the last one month.
Write in Markdown · Publish articles on custom domain · Gain readership on day zero · Automatic GitHub backup and more
NodeJS (just like Tomcat, Apache, etc) will probably do fine serving static files, while NGINX will give you much better performance since it was built in C and supports the sendfile system call which is as fast as you can get on a Linux OS.
The test I ran was 10,000 requests using 40 concurrent connections. Node.js averaged 862 requests/sec and Nginx averaged 1,608 requests/sec. This means Nginx can handle roughly double the throughput in my test environment.