Skip to content

Instantly share code, notes, and snippets.

@rundel
Created January 20, 2023 17:35
Show Gist options
  • Save rundel/e79ec14dda7130a3326757ee67ff97eb to your computer and use it in GitHub Desktop.
Save rundel/e79ec14dda7130a3326757ee67ff97eb to your computer and use it in GitHub Desktop.
import asyncio
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
async def main():
app = make_app()
app.listen(8888)
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment