Package io.cloudstub.local
Class LocalServer
java.lang.Object
io.cloudstub.local.LocalServer
- All Implemented Interfaces:
Closeable,AutoCloseable
The cloudstub-local HTTP server for the secondary management port (REST API + web console).
Serves on a secondary port (default 4567), separate from the AWS mock port. REST API routes:
GET /api/status— port, uptime, loaded modules and their stubs, all routesPOST /api/reset— clear all statePOST /api/reset?service=X— clear state for service XGET /api/history— all captured requestsGET /api/history?service=X— requests filtered by serviceGET /api/openapi.json— OpenAPI 3.0 spec auto-generated from registered routes
It also serves the web console at /console when its assets are bundled (redirecting
/ to /console/); a headless build runs API-only.
Modules register additional API routes by implementing CloudStubApiService.
-
Constructor Summary
ConstructorsConstructorDescriptionLocalServer(CloudStub cloudMock, int port, List<CloudStubApiService> moduleServices) -
Method Summary
-
Constructor Details
-
LocalServer
-
-
Method Details
-
start
- Throws:
IOException
-
stop
public void stop() -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
port
public int port()The port the API is listening on. When constructed with port0, this returns the ephemeral port the OS assigned atstart()time rather than0.
-