mercredi 27 juillet 2022

Nestjs Middleware - how to organize the api calls to third api

I have some issue to decide how to organize my code. I'm building a middleware using an external api. My wondering is how i should manage the api calls to this external api. I was thinking about creating a service file which will just manage it, or to have just one service file with all methods in it (the ones to call the external api, and the ones who will manage the datas). But neither of the two proposals I made really appeal to me.

Maybe i've missed a good design pattern which can handle it.

Aucun commentaire:

Enregistrer un commentaire