|
|
|
|
|
by data37
3587 days ago
|
|
Here is what I settled with for my website after trying a few things over the years. In the process I have discarded nodejs, JAX-RS, maven, Undertow, JQuery, bootstrap (partially) etc. Currently, pure java servlets serve json over REST-like API. The jar dependencies are servlet-api.jar, a couple of json-related jars and an sqlite jar. Multiple fine-grained sqlite files for data. Tomcat as the servlet container with no static content. A nodejs reverse proxy forks the API and static web requests between tomcat and another nodejs static webserver. The static content is angualrjs + html + css with minimal and reusable js files mostly fetching json data. I also have a little bootstrap dependency for forms. I have an apache ant build file that copies the ~60kb war file and static content directly to the production from my dev system. Tried maven before but Ant seemed much simpler and more than enough for my needs. The ant build does a lot other things also. I use Eclipse for the easy navigability across the code and other nice refactoring features. Ant does all the build work. Earlier I tried pure nodejs (no java), then JAX-RS and then Undertow container etc. Nothing seemed simpler than the current setup. By the way, the site is https://worktheme.com |
|
Just curious why you don't use nginx here. It will serve static files and proxy to the API. I'm sure the nodejs proxy was easy enough, but adding in gzipping files, rewrite rules, SSL, etc and it seems like nginx would even end up being more simple.