Add Pydantic models and FastAPI router structure for agent and backend
CI / basic-check (push) Has been cancelled
CI / basic-check (push) Has been cancelled
This commit is contained in:
+18
-7
@@ -1,11 +1,22 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
app = FastAPI(title="NetMapper API", version="0.1.0")
|
||||
from app.routers.discoveries import router as discoveries_router
|
||||
from app.routers.health import router as health_router
|
||||
from app.routers.jobs import router as jobs_router
|
||||
from app.routers.objects import router as objects_router
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
app = FastAPI(title='NetMapper Backend', version='0.1.0')
|
||||
|
||||
@app.get("/api/v1")
|
||||
def root():
|
||||
return {"service": "netmapper-backend", "version": "0.1.0"}
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=['*'],
|
||||
allow_credentials=True,
|
||||
allow_methods=['*'],
|
||||
allow_headers=['*'],
|
||||
)
|
||||
|
||||
app.include_router(health_router)
|
||||
app.include_router(objects_router)
|
||||
app.include_router(jobs_router)
|
||||
app.include_router(discoveries_router)
|
||||
|
||||
Reference in New Issue
Block a user