Implement a kind of http object that makes requests in next js app #62620
keven-bardales
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
Background
I was trying to make my fetch request to my external api and whenever it responds a 403 forbidden message i want to redirect to a page in each request.
Proposal
I would say a global object could be exported or a custom class with singleton partern and adding functionalities like interceptors.
Only thing i know could do this is axios interceptors but i think it would be great an implementation with the fetch api.
Beta Was this translation helpful? Give feedback.
All reactions