labthings / labthings/labthings-fastapi
Configure using environment variables
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
#73 introduced the ability to configure a server using a file or command line flags. However, if we're running from a server process using ASGI, rather than directly from the command line using uvicorn, we won't get command line arguments. I propose we swap the command line flags for environment variables, which can be used more reliably to set the parameters. Specifically, something like LABTHINGS_CONFIG_FILE or LABTHINGS_CONFIG_JSON would be best. It might be simpler just to force the use of a file - temp files can always be used for testing, if necessary: that was the main motivation for the ability to supply json directly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the configuration support introduced in issue #73 and trace how command-line flags reach the server when launched through uvicorn versus ASGI. Clarify whether environment variables should replace the flags, support a config file, or also accept JSON; done means the selected configuration path works for ASGI startup and is covered by the relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100