@@ -105,13 +105,11 @@ def register_middlewares(dp: Dispatcher) -> None:
105105
106106
107107def register_workflow_data (dp : Dispatcher , lexicon : Lexicon , app_settings : App ) -> None :
108- base_url = app_settings .url .rstrip ('/' )
109- web_app_path = '/' + app_settings .web_app_path .lstrip ('/' )
110108 dp .workflow_data .update ({
111109 'lexicon' : lexicon ,
112110 'keyboards' : Keyboards (),
113111 'bot_service' : BotService (),
114- 'web_app_url' : f' { base_url } { web_app_path } ' ,
112+ 'web_app_url' : app_settings . web_app_url ,
115113 })
116114
117115
@@ -120,9 +118,9 @@ def create_app(bot: Bot, dp: Dispatcher, settings: App) -> FastAPI:
120118 app .add_event_handler ('startup' , create_startup_handler (bot , dp , settings .url + settings .webhook_path ))
121119 app .add_event_handler ('shutdown' , create_shutdown_handler (bot , settings .debug ))
122120 app .add_api_route (settings .webhook_path , create_webhook_handler (bot , dp ), methods = ['POST' ])
123- app .add_api_route (settings .health_path , lambda : {" status" : "ok" }, methods = [" GET" ])
121+ app .add_api_route (settings .health_path , lambda : {' status' : 'ok' }, methods = [' GET' ])
124122 web_app_dir = Path (__file__ ).resolve ().parent / 'webapp'
125- app .mount (settings . web_app_path , StaticFiles (directory = web_app_dir , html = True ), name = 'webapp' )
123+ app .mount ('/webapp' , StaticFiles (directory = web_app_dir , html = True ), name = 'webapp' )
126124
127125 return app
128126
0 commit comments