is there any way to run bottle application in daemon mode

前端 未结 1 1882
臣服心动
臣服心动 2021-02-06 16:34

I have a web application built on bottle(python) frame work and I want to run it in daemon mode.Is there any way to run it in daemon mode

Thanks

1条回答
  •  臣服心动
    2021-02-06 17:28

    Sure you can. Install BottleDaemon 0.1.0 on your OS and than change your router file like so:

        from bottledaemon import daemon_run
        from bottle import route
    
        @route("/hello")
        def hello():
          return "Hello World"
    
        # The following lines will call the BottleDaemon script and launch a daemon in the background.
        if __name__ == "__main__":
          daemon_run()
    

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