When use Application Logic to handle files instead of Web Server?

In a SPA (Single Page Application), you need to serve the index.html for all requests that are not meant to specific files(.js, .css, .jpeg…) or to the API (which may be using a namespace /api, for example).

Apache, Nginx, Tomcat are types of web server that can handle this in the configuration files.

But you can also handle it in the application logic, one example is express.js or hapi.js for Node.js. These libraries make it simple to serve the application, you just need to send all requests to the application and it handles the static files, API calls, etc…

So, if the application can handle the files, should the server be concerned about it? Is performance, maintenance, or other aspects significantly influenced by it?