Hey guys, how are you today?!
It's 2024, let's make this year wonderful and do a lot of some cool things!
Today I'd like to share and talk about ...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
An alternative to cloning the request would be using an HttpClientFactory with the API URL as an argument. It was interesting seeing an example with HttpInterceptor though!
Wow, the way you commented too is very interesting! I'll try to understand better and apply it to have another way! Thanks ✌️
Renan Ferro,
Great article !
Thanks for sharing...
Muito obrigado João, fico feliz que tenha gostado 😄
Nice idea of use the base URL constant inside the Interceptor!
Eaee man
Bem legal né?! Facilita bastante 😆
Haha, interceptors are really great, once you wrap your head around them, you can begin to appreciate the design pattern.
Yes, things get more interesting each time 🤣
Still thinking their environment files are good for this. If you need to change the baseUrl -> just change the value (per env). Interceptors I would use for something like tokens or something like that. This we don't need to have in services, but we can inject this type of stuff in the interceptors.