From 9a62e94261e6531c6b60d296322e0cef2a5b21e1 Mon Sep 17 00:00:00 2001 From: Kostya Date: Fri, 9 Oct 2026 12:55:16 +0300 Subject: 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. --- server/.project | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 server/.project (limited to 'server/.project') diff --git a/server/.project b/server/.project new file mode 100644 index 0000000..f807d88 --- /dev/null +++ b/server/.project @@ -0,0 +1,29 @@ + + + guess-market-server + + + guess-market-api + guess-market-service + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.jdt.core.javanature + + + + 1791557442636 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + -- cgit v1.2.3