Remove unused APP_HOST/APP_PORT settings
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
# App server
|
|
||||||
APP_HOST=0.0.0.0
|
|
||||||
APP_PORT=8000
|
|
||||||
|
|
||||||
# Name used in the HTML page title/heading and the curl examples
|
# Name used in the HTML page title/heading and the curl examples
|
||||||
# (e.g. "ifconfig.me" when deployed under that domain).
|
# (e.g. "ifconfig.me" when deployed under that domain).
|
||||||
SITE_NAME=pyfconfig
|
SITE_NAME=pyfconfig
|
||||||
|
|||||||
@@ -69,10 +69,11 @@ Environment variables (see `.env.example`):
|
|||||||
|
|
||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `APP_HOST` | `0.0.0.0` | Bind host (informational; granian is configured via `GRANIAN_*`) |
|
|
||||||
| `APP_PORT` | `8000` | Bind port (informational) |
|
|
||||||
| `SITE_NAME` | `pyfconfig` | Public name used in the HTML page title and the curl examples (set to your domain, e.g. `ifconfig.example.com`) |
|
| `SITE_NAME` | `pyfconfig` | Public name used in the HTML page title and the curl examples (set to your domain, e.g. `ifconfig.example.com`) |
|
||||||
|
|
||||||
|
The bind address is configured through Granian itself (`GRANIAN_HOST` /
|
||||||
|
`GRANIAN_PORT` env vars or `--host` / `--port` CLI flags).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -21,15 +21,11 @@ def _env(name: str, default: Optional[str] = None) -> str:
|
|||||||
|
|
||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class Settings:
|
class Settings:
|
||||||
app_host: str
|
|
||||||
app_port: int
|
|
||||||
site_name: str
|
site_name: str
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_env() -> "Settings":
|
def from_env() -> "Settings":
|
||||||
return Settings(
|
return Settings(
|
||||||
app_host=_env("APP_HOST", "0.0.0.0"),
|
|
||||||
app_port=int(_env("APP_PORT", "8000")),
|
|
||||||
# Public name of the deployment, used in the HTML page title
|
# Public name of the deployment, used in the HTML page title
|
||||||
# and in the command-line examples (e.g. "ifconfig.me").
|
# and in the command-line examples (e.g. "ifconfig.me").
|
||||||
site_name=_env("SITE_NAME", "pyfconfig"),
|
site_name=_env("SITE_NAME", "pyfconfig"),
|
||||||
|
|||||||
Reference in New Issue
Block a user