Created
June 13, 2010 19:01
-
-
Save drewww/436898 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
class MainHandler(tornado.web.RequestHandler): | |
def get(self): | |
self.write("Hello, world") | |
application = tornado.web.Application([ | |
(r"/", MainHandler), | |
]) | |
if __name__ == "__main__": | |
http_server = tornado.httpserver.HTTPServer(application) | |
http_server.listen(8888) | |
tornado.ioloop.IOLoop.instance().start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>test</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
function init() { | |
$.ajax({url:"http://localhost:8888/", success: function(response) {alert("response: " + response);}, method:"GET"}); | |
} | |
</script> | |
</head> | |
<body id="test" onload="init()"> | |
<h1>Tornado/JS Request Testing</h1> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment