Adding new handler to running python tornado server

后端 未结 1 1375
我寻月下人不归
我寻月下人不归 2020-12-18 07:13

I\'m new to python tornado server, and I were evaluating python tornado for my next project that has to work on real time environment. I\'ve run a sample code from github wi

相关标签:
1条回答
  • 2020-12-18 07:35

    You'll need the tornado.web.Application's add_handlers method; use it like this:

    app.add_handlers(
        r".*",  # match any host
        [
            (
                r"/foo/([^/]*)",
                FooHandler
            ),
            (
                r"/bar/([^/]*)",
                BarHandler
            ),
        ]
    )
    

    Judging by its code, it does not block anything.

    0 讨论(0)
提交回复
热议问题