Using async/await in OpenWhisk
I'm currently writing an OpenWhisk action in JavaScript that searches Twitter using their API. To do this, I need to get a bearer token from one API endpoint and then call the search endpoint. Disclaimer: I'm in no way a JavaScript expert, so I would love it if you could constructively suggest improvements in the comments! To do this in OpenWhisk, you need to use Promises like this: