소스 검색

simplify flask router config

wangweimin 5 년 전
부모
커밋
b98ee77966
1개의 변경된 파일1개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 4
      pywebio/platform/flask.py

+ 1 - 4
pywebio/platform/flask.py

@@ -157,11 +157,8 @@ def start_server(target, port=8080, host='localhost',
     app.route('/io', methods=['GET', 'POST'])(webio_view(target, session_expire_seconds))
 
     @app.route('/')
-    def index_page():
-        return send_from_directory(STATIC_PATH, 'index.html')
-
     @app.route('/<path:static_file>')
-    def serve_static_file(static_file):
+    def serve_static_file(static_file='index.html'):
         return send_from_directory(STATIC_PATH, static_file)
 
     if not disable_asyncio and get_session_implement() is CoroutineBasedSession: