Setup script cleanup. Use discovered app module and var names when creating __main__.py from template. README updates.

This commit is contained in:
2026-01-17 23:04:07 +00:00
parent 64f43df3e3
commit 2dec331afb
3 changed files with 98 additions and 92 deletions
+3 -3
View File
@@ -6,20 +6,20 @@ import uvicorn
from fastapi_vue.hostutil import parse_endpoint
from uvicorn import Config, Server
from .app import app
from .APP_MODULE import APP_VAR
DEFAULT_PORT = 5080
def run_server(endpoints: list[dict], *, proxy="", devmode=False):
conf: dict[str, object] = {"app": "MODULE_NAME.app:app"}
conf: dict[str, object] = {"app": "MODULE_NAME.APP_MODULE:APP_VAR"}
if proxy:
conf["proxy_headers"] = True
conf["forwarded_allow_ips"] = proxy
if devmode:
conf["reload"] = True
conf["reload_dirs"] = ["MODULE_NAME"]
app.debug = True
APP_VAR.debug = True
if len(endpoints) > 1:
# Run separate servers for multiple endpoints