One of my friends started an online challenge, where participant submit their answers as a public git repository.
the challenge is to create two simple endpoints:
A. curl -X POST http://localhost -d 'some number'
B. curl http://localhost/count
where in A, we receive a number and we add it to previous numbers and in B we return that sum.
for example if we call API in the following order:
curl -X POST http://localhost -d '5'
curl -X POST http://localhost -d '6'
then http://localhost/count endpoint should return 11
I don't know Rust very well, but I used Rust and Tokio to create an API:
What do you offer to improve the response time?
You might like to see other competitors code, these are the top 3:
https://github.com/thebrodmann/soallpeach/tree/master/countme <-- haskel I guess