Separate application for the interface - build and deployment strategies

It is believed that when creating rich browser applications (JS-heavy), it should be considered as a separate application, and not as part of the "backend". I wonder how the assembly and deployment is implemented in such a setup?

Say I have a Java WAR file that provides a JSON-based API (be it JAX-RS or something else) - there are no views. Then I have static content for my frontend application: js script html views, CSS styles, images, etc. I could use a dedicated build tool, for example. GruntJS for this project to minimize / preprocess etc.

But now I'm kinda stuck. What should be the result of such an assembly? Only share WAR with static files created by Grunt? What about deployment? Should I combine these WARs together into one fully functional application or deploy two separate ones, for example. example.comserves for static and those statics are used api.example.comto obtain data.

Another development issue. As a result, I would like my js and css to be combined and generalized, but this is not so good for development (debugging is hard, etc.). Is there any trick to have separate source files in dev mode and only merged in the prod assembly?

+5
source share
1 answer

Java WebDev , . , API- , , , , . API , , , API . , . , . api.example.com example.com.

: - ANT script, . JS "" script . script, . Idk, .

0

All Articles