Created
September 2, 2013 06:45
-
-
Save damianesteban/6409851 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
#sudo apt-get install python-tornado | |
#there is an altertive as python3-tornado | |
#file below code into hello.py | |
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__": | |
application.listen(8888) | |
tornado.ioloop.IOLoop.instance().start() | |
#python hello.py | |
#curl <ip>:8888 | |
#Hello, worldroot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment