feat: add FastAPI app entrypoint
This commit is contained in:
0
backend/app/api/__init__.py
Normal file
0
backend/app/api/__init__.py
Normal file
26
backend/app/main.py
Normal file
26
backend/app/main.py
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
from fastapi import FastAPI
|
||||||
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
from app.api import auth, configs, zones, interfaces, policies, rules, masq
|
||||||
|
|
||||||
|
app = FastAPI(title="Shorefront", version="0.1.0")
|
||||||
|
|
||||||
|
app.add_middleware(
|
||||||
|
CORSMiddleware,
|
||||||
|
allow_origins=["http://localhost:5173", "http://localhost:80"],
|
||||||
|
allow_credentials=True,
|
||||||
|
allow_methods=["*"],
|
||||||
|
allow_headers=["*"],
|
||||||
|
)
|
||||||
|
|
||||||
|
app.include_router(auth.router, prefix="/auth", tags=["auth"])
|
||||||
|
app.include_router(configs.router, prefix="/configs", tags=["configs"])
|
||||||
|
app.include_router(zones.router, prefix="/configs", tags=["zones"])
|
||||||
|
app.include_router(interfaces.router, prefix="/configs", tags=["interfaces"])
|
||||||
|
app.include_router(policies.router, prefix="/configs", tags=["policies"])
|
||||||
|
app.include_router(rules.router, prefix="/configs", tags=["rules"])
|
||||||
|
app.include_router(masq.router, prefix="/configs", tags=["masq"])
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/health")
|
||||||
|
def health() -> dict:
|
||||||
|
return {"status": "ok"}
|
||||||
Reference in New Issue
Block a user