5 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
6 <title>FastCGI API Test</title>
9 font-family: "Trebuchet MS", "Verdana", "Arial", "Sans";
14 border-bottom: 1px solid gray;
17 border: 1px solid gray;
21 background-color: GhostWhite;
26 $(document).ready(function()
28 $('#inputquery').submit(function ()
30 $('#output').text("Submitting query...");
31 var query = $('#inputquery').find('input[name="query"]').val();
34 var start = d.getMilliseconds();
35 var domain = document.domain == "mctx.us.to" ? "mctx.us.to:8080" : document.domain;
36 $.getJSON('http://'+domain+'/api/'+query, function(data) {
38 var timeDiff = d.getMilliseconds() - start; //Not precise at all, use web console
40 $.each(data, function(key, val) {
41 items.push('<li>"' + key + '" : "' + val + '"</li>');
45 $('#output').html("Response ok (" + timeDiff + "ms)! Output:<br>");
47 html: items.join("\n")
48 }).appendTo('#output');
50 }).fail(function(jqXHR) {
51 $('#output').text("Query failed with response code: " + jqXHR.status);
60 <h1>FastCGI API Test</h1>
61 The API is located at: <a href="http://mctx.us.to:8080/api/">http://mctx.us.to:8080/api/</a><br>
63 Place a query string here. Examples include:<br>
65 <li><pre>sensors?key=value&key2</pre></li>
66 <li><pre>doesntexist?f</pre></li>
68 Response times are inaccurate via JavaScript. Use the web console of
69 your browser to determine how long the query takes.<br>
70 Hopefully this doesn't break!
72 <form id="inputquery" name="input" action="#">
73 Query string: <input type="text" name="query"><br>
74 <input type="submit" value="Submit">
79 <div id="output" class="io">