Mercurial > piecrust2
annotate piecrust/serving/wrappers.py @ 634:14eec6faf10b 2.0.0b4
docs: Make FoodTruck screenshots the proper size.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 09 Feb 2016 21:37:12 -0800 |
parents | 9ab005db2592 |
children | 3ceeca7bb71c |
rev | line source |
---|---|
374
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 import os |
558
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
2 import signal |
552
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
3 import logging |
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
4 import threading |
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
5 import urllib.request |
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
6 |
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
7 |
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
8 logger = logging.getLogger(__name__) |
374
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
9 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 def run_werkzeug_server(root_dir, host, port, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 debug_piecrust=False, sub_cache_dir=None, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 use_debugger=False, use_reloader=False): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
14 from werkzeug.serving import run_simple |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
15 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
16 def _run_sse_check(): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
17 # We don't want to run the processing loop here if this isn't |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
18 # the actual process that does the serving. In most cases it is, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
19 # but if we're using Werkzeug's reloader, then it won't be the |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
20 # first time we get there... it will only be the correct process |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 # the second time, when the reloading process is spawned, with the |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
22 # `WERKZEUG_RUN_MAIN` variable set. |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
23 return (not use_reloader or |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
24 os.environ.get('WERKZEUG_RUN_MAIN') == 'true') |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
25 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
26 app = _get_piecrust_server(root_dir, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
27 debug=debug_piecrust, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
28 sub_cache_dir=sub_cache_dir, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
29 run_sse_check=_run_sse_check) |
552
9612cfc6455a
serve: Rewrite of the Server-Sent Event code for build notifications.
Ludovic Chabant <ludovic@chabant.com>
parents:
374
diff
changeset
|
30 |
558
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
31 # We need to do a few things to get Werkzeug to properly shutdown or |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
32 # restart while SSE responses are running. This is because Werkzeug runs |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
33 # them in background threads (because we tell it to), but those threads |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
34 # are not marked as "daemon", so when the main thread tries to exit, it |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
35 # will wait on those SSE responses to end, which will pretty much never |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
36 # happen (except for a timeout or the user closing their browser). |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
37 # |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
38 # In theory we should be using a proper async server for this kind of |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
39 # stuff, but I'd rather avoid additional dependencies on stuff that's not |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
40 # necessarily super portable. |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
41 # |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
42 # Anyway, we run the server as usual, but we intercept the `SIGINT` |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
43 # signal for when the user presses `CTRL-C`. When that happens, we set a |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
44 # flag that will make all existing SSE loops return, which will make it |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
45 # possible for the main thread to end too. |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
46 # |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
47 # We also need to do a few thing for the "reloading" feature in Werkzeug, |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
48 # see the comment down there for more info. |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
49 def _shutdown_server(): |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
50 from piecrust.serving import procloop |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
51 procloop.server_shutdown = True |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
52 |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
53 def _shutdown_server_and_raise_sigint(): |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
54 if not use_reloader or os.environ.get('WERKZEUG_RUN_MAIN') == 'true': |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
55 # We only need to shutdown the SSE requests for the process |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
56 # that actually runs them. |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
57 print("") |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
58 print("Shutting server down...") |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
59 _shutdown_server() |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
60 raise KeyboardInterrupt() |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
61 |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
62 signal.signal(signal.SIGINT, |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
63 lambda *args: _shutdown_server_and_raise_sigint()) |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
64 |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
65 try: |
374
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
66 run_simple(host, port, app, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
67 threaded=True, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
68 use_debugger=use_debugger, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
69 use_reloader=use_reloader) |
558
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
70 except SystemExit: |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
71 if os.environ.get('WERKZEUG_RUN_MAIN') == 'true': |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
72 # When using the reloader, if code has changed, the child process |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
73 # will use `sys.exit` to end and let the master process restart |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
74 # it... we need to shutdown the SSE requests otherwise it will |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
75 # not exit. |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
76 _shutdown_server() |
9ab005db2592
serve: Improve reloading and shutdown of the preview server.
Ludovic Chabant <ludovic@chabant.com>
parents:
553
diff
changeset
|
77 raise |
374
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
78 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
79 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
80 def run_gunicorn_server(root_dir, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
81 debug_piecrust=False, sub_cache_dir=None, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
82 gunicorn_options=None): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
83 from gunicorn.app.base import BaseApplication |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
84 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
85 class PieCrustGunicornApplication(BaseApplication): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
86 def __init__(self, app, options): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
87 self.app = app |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
88 self.options = options |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
89 super(PieCrustGunicornApplication, self).__init__() |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
90 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
91 def load_config(self): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
92 for k, v in self.options.items(): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
93 if k in self.cfg.settings and v is not None: |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
94 self.cfg.set(k, v) |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
95 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
96 def load(self): |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
97 return self.app |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
98 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
99 app = _get_piecrust_server(root_dir, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
100 debug=debug_piecrust, |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
101 sub_cache_dir=sub_cache_dir) |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
102 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
103 gunicorn_options = gunicorn_options or {} |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
104 app_wrapper = PieCrustGunicornApplication(app, gunicorn_options) |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
105 app_wrapper.run() |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
106 |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
107 |
553
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
108 def _get_piecrust_server(root_dir, debug=False, sub_cache_dir=None, |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
109 run_sse_check=None): |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
110 from piecrust.serving.middlewares import ( |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
111 StaticResourcesMiddleware, PieCrustDebugMiddleware) |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
112 from piecrust.serving.server import WsgiServer |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
113 app = WsgiServer(root_dir, debug=debug, sub_cache_dir=sub_cache_dir) |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
114 app = StaticResourcesMiddleware(app) |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
115 app = PieCrustDebugMiddleware(app, root_dir, |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
116 sub_cache_dir=sub_cache_dir, |
cc6f3dbe3048
serve: Extract some of the server's functionality into WSGI middlewares.
Ludovic Chabant <ludovic@chabant.com>
parents:
552
diff
changeset
|
117 run_sse_check=run_sse_check) |
374
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
118 return app |
fa3ee8a8ee2d
serve: Split the server code in a couple modules inside a `serving` package.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
119 |