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)
| 78 | |
| 79 | |
| 80 | def 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 | |
| 105 | def wsgi_app(applications, cdn=True, |
no test coverage detected
searching dependent graphs…