I am working with a NodeJs App and I have to call to a online web service in the logic part.
The problem is that if that web service is taken down, the whole system stop working.
To deal with this I have though in use a Facade pattern, adding another web service with the same functionality, and one offline file with similar information (but not as good as the web service's).
The idea is call the Facade (javaScript file?) from the logic part. It has to choose first the primary web service and call it, if it is down, go for the second one, and if it is also down, call the offline data file.
Any idea about how to stucture this on NodeJS?