6.0.2 — one API address for both pages, a settings-driven launcher, and visible startup logs
Running the API and the web UI on different ports or hosts no longer needs
guesswork.
Added
python -m apistarts the server from settings (PR #127). It usesAPI_HOST(default127.0.0.1) andAPI_PORT(default8000) and sends noServerheader. An invalidAPI_PORTfails with a message naming it. The documenteduvicorn api.server:app ...command still works unchanged.- The server logs its allowed CORS origins at startup (PR #127). It also shows a hint in both pages when the backend cannot be reached. The hint names the two likely causes (the backend is not running, or this page's origin is missing from
CORS_ALLOWED_ORIGINS) and prints the origin to add.
Fixed
- The admin panel uses the same API address as the main UI (PR #127). Both pages read it from
web/js/config.js, with the same precedence:?base=, then a saved value, then the file. IfDEFAULT_BASE_URLis empty, both derive the address from the page's own host andDEFAULT_API_PORT. Before this, the admin panel ignored the file and started fromhttp://localhost:8000. - API addresses are normalised and validated (PR #127). An address typed without
http://is no longer treated as a relative path. Previously that sent requests such as/admin/<host>:<port>/admin/...to the static server. Now:- a missing scheme is added;
- whitespace, paths and credentials are dropped;
- IPv6 addresses work;
- anything else is rejected with a message, and the previous address stays in use.
- The application's own log lines are shown (PR #127). INFO-level lines, such as the startup banner and the CORS line, were silently dropped under both documented start commands. When nothing else has configured logging, they now go to stderr at
LOG_LEVEL(defaultINFO).
Upgrading
- No action needed for an existing setup.
- To use
python -m apion a server reached from other machines, setAPI_HOST=0.0.0.0; its default listens on the local machine only. - If the UI is served from anywhere other than
localhost:8080, setCORS_ALLOWED_ORIGINSto that origin, for examplehttp://172.16.101.42:8077.