node.js - Separate ports for app server and rest API server (Node) -


are there particular advantages/disadvantages using separate ports serving app (rendering pages) , rest api server? i'm working on building react, node/express app , see examples in author has served api on port 3030 , app on port 3000. seems decouple two, nice testing. there otherwise any distinct advantages of serving app , api on separate ports in node/express application?

separating api rendering server allows requests processed more efficiently segregating logic.

express won't have iterate through routes of page rendering endpoints reach callback api request, , won't have iterate through routes of api endpoints reach callback page rendering request.


Comments