@rmontgomery429 has provided this sample implementation in ruby. This is constructed here as a modular sinatra app but you app does not necessarily need to be modular. I've included the use of the sinatra-cross_origin gem which we required for our use case. Your use case may be different and this may not be required. I have not tested this specific gist of the app, but we do have a version of this

