A very basic dropwizard-guicey demo application: a very simple todo app. Includes the simplest delivery packaging using gradle application plugin.
Dropwizard 5 (guicey 8.x)
Could be used for bootstrapping new projects.
Based on https://todobackend.com/
Client based on: https://todomvc.com/ (ES5 https://todomvc.com/examples/javascript-es5/dist/)
Started application would be available on url: http://localhost:8080/
Web application is a simple ES5 application (without additional js processing).
It is served with dropwizard-assets.
All web resources are in src/main/resources/assets
Dev configuration located at project root: config.yml
Delivery created by the gradle application plugin. Run scrips are generated into
bin/ delivery directory (scripts renamed for simplicity to startup instead of project name)
src/dist directory contains additional delivery files: production configuration and run script.
./gradle runstarts application with dev config./gradlew distZipbuild zip delivery archive available inbuild/deliveries./gradlew installDistcreates delivery inbuild/install/so delivery content could be easily examined
For a default run (./gradlew) delivery would be created
Create run configuration for ru.vyarus.app.todo.TodoApp with arguments: server config.yml
Also shows lombok usage for model class (it could be also used for configuration class too)
In IntelliJIdea it should work out of the box. in case of problems read this guide
There are three versions of the same tests:
- Lightweight rest tests (stub rest, without starting web container)
- Integration test with (full application startup)
- Integration test with static client (when resource methods use for test call configuration) The same calls will work with lightweight rest too.
NOTE: as rest use PATCH method, default JerseyClient, prepared by guicey will not work on jdk > 16 (or see blog post) To workaround it, apache client factory is used.
Banner (banner.txt file content) was created in https://manytools.org/hacker-tools/ascii-banner/
(font: DOS Rebel)