We are working on a large scaled web app that built on top of javascript frameworks and libraries (node, express/sails, angular, mongo etc).
We need to have a backend that from one hand serve the web application but on the other accept API calls for data (from the same app but from other origins as well) - very common these days.
One of the decision we want to take is should we separate the backend for Web Application server and API server or put them together.
For example should we have an express running serving both or should express serve the web app, static content, auth etc and have a separate Restify server serving the data.
What are the pros and cons for each agenda?