@mytec: 1.2iter ready for test

This commit is contained in:
2026-01-30 23:47:17 +02:00
parent 58ee6b4163
commit d13233d8e3
7 changed files with 493 additions and 15 deletions

View File

@@ -1,13 +1,10 @@
import os
from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import FileResponse
from app.core.config import settings
from app.core.database import connect_to_mongo, close_mongo_connection
from app.api.routes import health, projects
from app.api.routes import health, projects, terrain
@asynccontextmanager
@@ -20,7 +17,7 @@ async def lifespan(app: FastAPI):
app = FastAPI(
title="RFCP Backend API",
description="RF Coverage Planning Backend",
version="1.1.0",
version="1.2.0",
lifespan=lifespan,
)
@@ -36,20 +33,12 @@ app.add_middleware(
# Routes
app.include_router(health.router, prefix="/api/health", tags=["health"])
app.include_router(projects.router, prefix="/api/projects", tags=["projects"])
app.include_router(terrain.router, prefix="/api/terrain", tags=["terrain"])
@app.get("/")
async def root():
return {"message": "RFCP Backend API", "version": "1.1.0"}
@app.get("/api/terrain/{region}")
async def get_terrain(region: str):
"""Serve SRTM terrain .hgt files."""
terrain_path = os.path.join(settings.TERRAIN_DATA_DIR, f"{region}.hgt")
if os.path.exists(terrain_path):
return FileResponse(terrain_path)
return {"error": "Region not found"}, 404
return {"message": "RFCP Backend API", "version": "1.2.0"}
if __name__ == "__main__":