I tried to write a simple cgi that would fake a search result but I couldn't get the POST preflight CORS right in the time I devoted to this example. Note: The HTML plugin translates all form behavior, including method GET, into XHR POST with JSON arguments.

I wanted to use cgi in this example because they are easier to keep running for long periods. Sinatra seems to get the preflight right as I am using the same ajax approach in the Search plugin itself. github