MCPcopy Index your code
hub / github.com/pywebio/PyWebIO / webio_view

Function webio_view

pywebio/platform/flask.py:80–102  ·  view source on GitHub ↗

Get the view function for running PyWebIO applications in Flask. The view communicates with the browser by HTTP protocol. The arguments of ``webio_view()`` have the same meaning as for :func:`pywebio.platform.flask.start_server`

(applications, cdn=True,
               session_expire_seconds=None,
               session_cleanup_interval=None,
               allowed_origins=None, check_origin=None)

Source from the content-addressed store, hash-verified

78
79
80def webio_view(applications, cdn=True,
81 session_expire_seconds=None,
82 session_cleanup_interval=None,
83 allowed_origins=None, check_origin=None):
84 """Get the view function for running PyWebIO applications in Flask.
85 The view communicates with the browser by HTTP protocol.
86
87 The arguments of ``webio_view()`` have the same meaning as for :func:`pywebio.platform.flask.start_server`
88 """
89
90 cdn = cdn_validation(cdn, 'error')
91
92 handler = HttpHandler(applications=applications, cdn=cdn,
93 session_expire_seconds=session_expire_seconds,
94 session_cleanup_interval=session_cleanup_interval,
95 allowed_origins=allowed_origins, check_origin=check_origin)
96
97 def view_func():
98 context = FlaskHttpContext()
99 return handler.handle_request(context)
100
101 view_func.__name__ = 'webio_view'
102 return view_func
103
104
105def wsgi_app(applications, cdn=True,

Callers 2

start_test_serverFunction · 0.90
wsgi_appFunction · 0.70

Calls 2

cdn_validationFunction · 0.85
HttpHandlerClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…