Local HTTP server exposing configurable endpoints to be benchmarked for testing purposes.
go run ./...
Note: default port is 9999
. It can be overrided with flag -port
:
go run ./... -port 80
Typing the command debug
in the CLI while the server is running will output
the count of received requests since it started.
The server exposes two endpoints:
-
GET /
Response code: 200 Response body: <empty> Optional query params: - `delay` (`time.Duration`): minimum duration before response - `fib` (`int`): nth element in fibonacci's suite to calculate before reponse
-
GET /debug
Response code: 200 Response body: <received requests count> (raw text)
http://localhost:9999?delay=250ms
http://localhost:9999?fib=40
http://localhost:9999?fib=40&delay=3s