From 5aae0ec450daa4066bf2f794b1fa12c0d3dc06d8 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 23 Jan 2025 17:37:32 -0600 Subject: [PATCH] fix: add `root_path` config setting for running webapp via uvicorn --- src/wuttaweb/cli/webapp.py | 1 + tests/cli/test_webapp.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/wuttaweb/cli/webapp.py b/src/wuttaweb/cli/webapp.py index 5f17052..d81ae58 100644 --- a/src/wuttaweb/cli/webapp.py +++ b/src/wuttaweb/cli/webapp.py @@ -74,6 +74,7 @@ def webapp( 'reload_dirs': config.get_list(f'{config.appname}.web.app.reload_dirs'), 'factory': config.get_bool(f'{config.appname}.web.app.factory', default=False), 'interface': config.get(f'{config.appname}.web.app.interface', default='auto'), + 'root_path': config.get(f'{config.appname}.web.app.root_path'), } # also must inject our config files to env, since there is no diff --git a/tests/cli/test_webapp.py b/tests/cli/test_webapp.py index 1e23752..eaa1f6a 100644 --- a/tests/cli/test_webapp.py +++ b/tests/cli/test_webapp.py @@ -88,7 +88,8 @@ app.spec = wuttaweb.app:make_wsgi_app reload=False, reload_dirs=None, factory=False, - interface='auto') + interface='auto', + root_path=None) # with reload uvicorn.run.reset_mock() @@ -101,4 +102,5 @@ app.spec = wuttaweb.app:make_wsgi_app reload=True, reload_dirs=None, factory=False, - interface='auto') + interface='auto', + root_path=None)