Reactjs for frontend, CF for backend?

My best experience was creating two webroots: One for the frontend SPA, all done with node npm/dev on VScode. Another one for Lucee that delivered all logic and content through tomcats default port 8888. Besides on having them setup on different domains (just for development), I’ve created an API directory in Lucee, for example www.siteAPI.com/api/whatever.cfm. This URL can easily be requested by the SPA frontend using Lucees default port 8888. Cross-Origin-Headers can be set inside the application.cfc of the API and the requesting urls in the global javascript scope of the SPA. When you go into production, all you need to do is change that variables (2 lines), and migrate both webroots by simply copying the builds of the nodejs webroot to lucees webroot. Because the frontend is plain static HTML and Javascript, everything can be done by Lucee in production.

What I like about this setup is a clean separation of development for SPA and API. No need of some nodes npm prebuilding watch options or issues with conflicting web engines.

1 Like