-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
29 lines (29 loc) · 868 Bytes
/
Copy pathindex.html
File metadata and controls
29 lines (29 loc) · 868 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!doctype html>
<html>
<head>
<title>API Echo</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px; }
#title { font: 16px courier;}
#subtitle { font: 14px courier; }
#requests pre:nth-child(odd) { background: #eee; }
</style>
</head>
<body>
<pre id="title">API Request Echo</pre>
<pre id="subtitle">Showing requests to /echo/...</pre>
<div id="requests"></div>
<script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
<script>
$(function () {
var socket = io();
socket.on('request', function(info){
$('#requests').append($('<pre>').text(info));
window.scrollTo(0, document.body.scrollHeight);
});
});
</script>
</body>
</html>