Open BertKiv opened 2 years ago
OK, I solved it. When I'm finished I'll send you a PR.
Hey, sorry it took me so long to reply. just reviewing your PR now. So this looks like the FastAPI API has changed in a recent version. The general ideas of your PR seem to be on the right track. Unfortunately, this is actually a little more complicated. According to the HTTP spec, the health service registration request needs to be a PUT or POST as its sending a JSON body with information that has semantic meaning to the request (not allowed in a GET).
I have added comments (or am in the process of adding them) to you PR. Would you like to try to submit again making those changes? I'll leave this issue open for discourse until we merge your PR.
Thanks for taking an interest in this project and learning about its internals!
I need something like PicoAPI in my project so I can take care of it. I also want to extend PicoAPI with routing to slave microservices for a more complete solution and fits to my needs, but not only mine, I think :-)
I am using Docker and docker-compose and cannot register a slave service. What am I doing wrong? Api Gateway (main service) works like a charm but slave service registration fails.
I am not a FastAPI and Python master ;-)
Service main.py:
.env file:
Dockerfiles:
docker-compose.yml
Error:
What I was checking
When I change the slave service from PicoAPI to FastAPI and manually register with CUrl everything looks fine.
Checking status from gateway:
Result:
"status": "unhealthy" has no meaning as there is no /health endpoint.