This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is a quick example of how to fake out the response for calling a Google API endpoint. | |
I'm using the QPX Express api as an example, but I'm _assuming_ this could apply accross the board | |
for other Google API's. | |
The reason you would want to do this, is so you don't need to hit the internet to get your results | |
(think, coding on a plane, no internet coverage, no hurting your API allowance, etc). | |
The main trick here is that we need to do two things: | |
1. Create a fake HttpMessageHandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |