How to intercept calls to external services with middlewares and make it flexible enough to quickly change target environment.

So you probably have worked with middlewares or at least have an idea of how they work.

Ok, basically a middleware is a piece of software which connects two applications and make data flow through them. There are different types of middlewares, but for the purpose of the article let’s focus on web middlewares.

If you are familiar with express and you are implementing your custom middleware you could see something like this:

Ok, basically this middleware accepts three parameters: req…

Mike Tcholakian

Passionate on technology, continuos learner, making mistakes all the time, not to regret it =) Try harder the next time, dont fail in the process,!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store