mirror of
https://github.com/azaion/gps-denied-onboard.git
synced 2026-04-23 04:26:36 +00:00
feat: stage0 — init Python package, FastAPI health endpoint, tests
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
"""GPS-Denied Onboard — UAV geolocalization service."""
|
||||
|
||||
__version__ = "0.1.0"
|
||||
@@ -0,0 +1,16 @@
|
||||
"""Entry point: python -m gps_denied."""
|
||||
|
||||
import uvicorn
|
||||
|
||||
|
||||
def main() -> None:
|
||||
uvicorn.run(
|
||||
"gps_denied.app:app",
|
||||
host="127.0.0.1",
|
||||
port=8000,
|
||||
reload=True,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,23 @@
|
||||
"""FastAPI application factory."""
|
||||
|
||||
from fastapi import FastAPI
|
||||
|
||||
from gps_denied import __version__
|
||||
|
||||
|
||||
def create_app() -> FastAPI:
|
||||
"""Create and configure the FastAPI application."""
|
||||
application = FastAPI(
|
||||
title="GPS-Denied Onboard",
|
||||
version=__version__,
|
||||
description="UAV geolocalization service for GPS-denied environments",
|
||||
)
|
||||
|
||||
@application.get("/health")
|
||||
async def health() -> dict:
|
||||
return {"status": "ok"}
|
||||
|
||||
return application
|
||||
|
||||
|
||||
app = create_app()
|
||||
Reference in New Issue
Block a user