Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test
  • Loading branch information
peterbe committed Apr 21, 2012
1 parent 3774c50 commit 46c9286
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app.py
Expand Up @@ -22,6 +22,13 @@ def get(self):
data = {'count': int(count) + 1}
self.write(data)

class HomeHandler(tornado.web.RequestHandler):
def get(self):
self.write("""<html>
<a href=/socktest>socktest</a><br>
<a href=/ajaxtest>ajaxtest</a><br>
</html>""")

def app():
app_settings = dict(
static_path=os.path.join(os.path.dirname(__file__), "static"),
Expand All @@ -30,6 +37,7 @@ def app():

)
return tornado.web.Application([
(r"/", HomeHandler),
(r"/socktest", SockHandler),
(r"/ajaxtest", AjaxHandler),
(r"/ajaxecho", AjaxEchoHandler),
Expand Down
3 changes: 1 addition & 2 deletions static/socktest.js
Expand Up @@ -7,9 +7,8 @@ SockJS.prototype.send_json = function(data) {
var loop = (function() {
var data_function;
var sock;

var initsock = function(callback) {
sock = new SockJS('http://localhost:9999/echo');
sock = new SockJS('http://' + location.hostname + ':9999/echo');

sock.onmessage = function(e) {
master_count = e.data.count;
Expand Down

0 comments on commit 46c9286

Please sign in to comment.