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

Function start_test_server

test/8.flask_multiple_session_impliment.py:47–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46
47def start_test_server():
48 pywebio.enable_debug()
49 from flask import Flask, send_from_directory
50 from pywebio.platform.flask import webio_view, run_event_loop
51 from pywebio import STATIC_PATH
52 import threading
53 import logging
54
55 app = Flask(__name__)
56 app.add_url_rule('/io', 'webio_view', webio_view(target, cdn=False), methods=['GET', 'POST', 'OPTIONS'])
57 app.add_url_rule('/io2', 'webio_view_async_target', webio_view(async_target, cdn=False), methods=['GET', 'POST', 'OPTIONS'])
58
59 @app.route('/')
60 @app.route('/<path:static_file>')
61 def serve_static_file(static_file='index.html'):
62 return send_from_directory(STATIC_PATH, static_file)
63
64 threading.Thread(target=run_event_loop, daemon=True).start()
65
66 logging.getLogger('werkzeug').setLevel(logging.WARNING)
67
68 app.run(port=8080, host='127.0.0.1')
69
70
71if __name__ == '__main__':

Callers

nothing calls this directly

Calls 2

webio_viewFunction · 0.90
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…