def main(): # tornado.options.parse_command_line() http_server = tornado.httpserver.HTTPServer(Application()) port = 8000 if not get_env("port") else int(get_env("port")) print("server is running on port {0}".format(port)) http_server.listen(port) tornado.ioloop.IOLoop.current().start()
def main(): # tornado.options.parse_command_line() http_server = tornado.httpserver.HTTPServer(Application()) port = int(os.environ.get("PORT", options.port)) print("server is running on port {0}".format(port)) http_server.listen(port) tornado.ioloop.IOLoop.current().start()
def get_app(self): app = Application() app.settings["xsrf_cookies"] = False # invalidate xsrf to test return app
import os import tornado from application.server import Application if __name__ == "__main__": app = Application() app.listen(int(os.environ.get("PORT", 8080))) tornado.ioloop.IOLoop.instance().start()