labthings / labthings/labthings-fastapi

Configure using environment variables

Open
#76 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.