And get the shim working to my taste
This commit is contained in:
parent
4840a15c00
commit
aa65b03d4a
1 changed files with 12 additions and 10 deletions
|
@ -5,20 +5,22 @@ import cherrypy
|
||||||
|
|
||||||
|
|
||||||
def shim(app):
|
def shim(app):
|
||||||
# Mount the application
|
|
||||||
cherrypy.tree.graft(app, "/")
|
cherrypy.tree.graft(app, "/")
|
||||||
|
|
||||||
# Unsubscribe the default server
|
|
||||||
cherrypy.server.unsubscribe()
|
cherrypy.server.unsubscribe()
|
||||||
|
|
||||||
# Instantiate a new server object
|
|
||||||
server = cherrypy._cpserver.Server()
|
server = cherrypy._cpserver.Server()
|
||||||
|
|
||||||
def _run(host="0.0.0.0", port=8080, pool_size=16):
|
def _run(host="0.0.0.0", port=8080, pool_size=16, environment="production"):
|
||||||
# Configure the server object
|
cherrypy.config.update(
|
||||||
server.socket_host = host
|
{
|
||||||
server.socket_port = port
|
"environment": environment,
|
||||||
server.thread_pool = pool_size
|
"server.socket_host": host,
|
||||||
|
"server.socket_port": port,
|
||||||
|
"server.thread_pool": pool_size,
|
||||||
|
"engine.autoreload.on": False,
|
||||||
|
"log.screen": True,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
server.subscribe()
|
server.subscribe()
|
||||||
cherrypy.engine.start()
|
cherrypy.engine.start()
|
||||||
cherrypy.engine.block()
|
cherrypy.engine.block()
|
||||||
|
|
Loading…
Reference in a new issue