The server implements a mock version of the Thunderstorm API that can be used for testing purposes. All requests do nothing but log the request and the response.
Download the latest release from the Releases page.
./thunderstorm-mock [options]| Flag | Environment Variable | Default | Description |
|---|---|---|---|
-p, --port |
THUNDERSTORM_MOCK_PORT |
8080 |
Port to listen on |
-a, --address |
THUNDERSTORM_MOCK_ADDRESS |
(all interfaces) | Address to bind to |
-o, --output |
THUNDERSTORM_MOCK_OUTPUT |
(stdout) | Log output file path |
-v, --version |
Print version and exit | ||
-h, --help |
Print help and exit |
CLI flags take precedence over environment variables.
# Start server on default port 8080
./thunderstorm-mock
# Start server on port 9000
./thunderstorm-mock --port 9000
# Bind to localhost only and log to file
./thunderstorm-mock --address 127.0.0.1 --output server.log
# Using environment variables
THUNDERSTORM_MOCK_PORT=9000 ./thunderstorm-mockThe server will be available at http://localhost:8080 (or your configured port).
go run main.goBuild the image:
docker build --network=host -t thunderstormmock .Run the container:
docker run --rm -it thunderstormmockThe server types and routing code are generated by oapi-codegen from the Thunderstorm OpenAPI specification. The spec is downloaded automatically during code generation.
To regenerate the code:
go generate ./api/...