Custom axios instance for each endpoint? #423
Unanswered
patryk-smc
asked this question in
Q&A
Replies: 1 comment 3 replies
-
You can attach zodios plugins per endpoint. Zodios plugins are like axios interceptors but with knowledge about api description. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
I am currently working with an API that seems to have a tendency towards timeouts on some of its endpoints. To address this, I have set up a custom axios instance with interceptors that handle retry logic. However, I am encountering an issue where some endpoints require a timeout of 2-3 seconds, while others require up to 30 seconds.
The problem lies in the fact that the Axios instance is attached globally to a group of endpoints within Zodios. As a result, it seems that the only way to work around this would be to create multiple Zodios instances for every endpoint that requires a different axios instance. Unfortunately, this solution doesn't feel optimal.
Do you have any suggestions for a better approach to this issue?
Beta Was this translation helpful? Give feedback.
All reactions