diff options
| author | Kostya <mail@sartin.in> | 2026-10-09 12:55:16 +0300 |
|---|---|---|
| committer | Kostya <mail@sartin.in> | 2026-10-09 12:55:40 +0300 |
| commit | 9a62e94261e6531c6b60d296322e0cef2a5b21e1 (patch) | |
| tree | f684d5b0f350161b331e53149e7c8dabb9e1c885 /tools | |
| parent | 246c1ab5ffce1a1bb3c0534868b29f6e4c862a62 (diff) | |
| download | guess-market-9a62e94261e6531c6b60d296322e0cef2a5b21e1.tar.gz guess-market-9a62e94261e6531c6b60d296322e0cef2a5b21e1.tar.xz guess-market-9a62e94261e6531c6b60d296322e0cef2a5b21e1.zip | |
server: add Tomcat webapp module with shared engine and CORS
Exercise 3 moves the market behind a Tomcat server that the desktop
and browser clients share. Add a server module, registered in the
build scripts, holding the pieces every later endpoint builds on:
- ServerEngine wires one in-memory market (repositories, ledger,
trading pipeline, v3 upload loader) and lives in the servlet context
for the webapp's lifetime. Its catalog refuses path-based loading,
so events can only arrive through uploaded streams and the server
never reads or writes files.
- EngineBootstrap builds that engine when the webapp deploys.
- CorsFilter answers preflights and echoes the caller's Origin with
Allow-Credentials, which the browser client needs to send its
session cookie from another origin. With usernames as the only
login, echoing any origin exposes nothing a page couldn't get by
logging in itself.
- /api/health reports that the engine is up.
Vendor tomcat-juli 10.1.26 next to the other Tomcat jars. It ships in
Tomcat's bin/ rather than lib/, and embedded Tomcat cannot start
without it. A test deploys the module into embedded Tomcat, so
annotation scanning, the health check and CORS are checked against a
real container.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/_util.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/_util.sh b/tools/_util.sh index d6e8db5..3a29ecb 100644 --- a/tools/_util.sh +++ b/tools/_util.sh | |||
| @@ -5,10 +5,11 @@ case "$(uname -s)" in | |||
| 5 | *) SEP=":" ;; | 5 | *) SEP=":" ;; |
| 6 | esac | 6 | esac |
| 7 | 7 | ||
| 8 | MODULES="api service ui-console ui-desktop" | 8 | MODULES="api service server ui-console ui-desktop" |
| 9 | 9 | ||
| 10 | DEPS_api="" | 10 | DEPS_api="" |
| 11 | DEPS_service="api" | 11 | DEPS_service="api" |
| 12 | DEPS_server="api service" | ||
| 12 | DEPS_ui_console="api service" | 13 | DEPS_ui_console="api service" |
| 13 | DEPS_ui_desktop="api service" | 14 | DEPS_ui_desktop="api service" |
| 14 | 15 | ||