DEV Community


Discussion on: An API Gateway

davidkroell profile image
David Kröll

Pretty decent project!
What happens if a host from your configuration is down? Is this case handled already?

afsharm profile image
Afshar Mohebi Author

In this step, what has returned from the down host is returned, will be returned to the original client. For example if a 500 error occurs or if a bad request happens, all the HTTP status, body and header is exactly repeated to the original client.

But by your good hint, I am inspired to ban the down host temporairly or permanently. So do not send requests to hosts which are down. The definition of down can be configurable. For example a timeout error and all 500 family error can be considered down and all other error can be consider repeatable actions.