Skip to content

Commit de5c48d

Browse files
authored
Breakout uvicorn logic from app (#2)
1 parent bac9316 commit de5c48d

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# STAC Auth Proxy
22

33
STAC Auth Proxy is a proxy API that mediates between the client and and some internally accessible STAC API in order to provide a flexible authentication mechanism.
4+
5+
## Development
6+
7+
```sh
8+
uv run python -m stac_auth_proxy
9+
```

src/stac_auth_proxy/__main__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import uvicorn
2+
from uvicorn.config import LOGGING_CONFIG
3+
4+
5+
LOGGING_CONFIG["loggers"][__package__] = {
6+
"level": "DEBUG",
7+
"handlers": ["default"],
8+
}
9+
10+
uvicorn.run(
11+
f"{__package__}.app:app",
12+
host="0.0.0.0",
13+
port=8000,
14+
log_config=LOGGING_CONFIG,
15+
reload=True,
16+
)

src/stac_auth_proxy/main.py renamed to src/stac_auth_proxy/app.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@
88
from fastapi import FastAPI
99

1010
app = FastAPI()
11-
12-
if __name__ == "__main__":
13-
import uvicorn
14-
15-
uvicorn.run(app, host="0.0.0.0", port=8000)

0 commit comments

Comments
 (0)