Frederic G. MARAND 66e1a7d954 Added some DI polish | 2 gadi atpakaļ | |
---|---|---|
.run | 2 gadi atpakaļ | |
cmd | 2 gadi atpakaļ | |
domain | 2 gadi atpakaļ | |
internal | 2 gadi atpakaļ | |
web | 2 gadi atpakaļ | |
.env | 2 gadi atpakaļ | |
.gitignore | 2 gadi atpakaļ | |
LICENSE | 2 gadi atpakaļ | |
Makefile | 2 gadi atpakaļ | |
README.md | 2 gadi atpakaļ | |
go.mod | 2 gadi atpakaļ | |
go.sum | 2 gadi atpakaļ |
"The original fizz-buzz consists in writing all numbers from 1 to 100, and just replacing all multiples of 3 by ""fizz"", all multiples of 5 by ""buzz"", and all multiples of 15 by ""fizzbuzz"". The output would look like this: ""1,2,fizz,4,buzz,fizz,7,8,fizz,buzz,11,fizz,13,14,fizzbuzz,16,...""."
Your goal is to implement a web server that will expose a REST API endpoint that:
The server needs to be:
Bonus: add a statistics endpoint allowing users to know what the most frequent request has been. This endpoint should:
int1
and int2
must be different and within the open interval ]1, limit[
.str1
and str2
must be valid path components as per RFC 3986 §2.2.:8080
FIZZBUZZ_ADDR
overrides default-addr
overrides environment variableNote: environment can be loaded from .env
file: see make serve
.
go.mod
-addr
flag, FIZZBUZZ_ADDR
env varSIGTERM
stdout
(not stderr
)