Initial commit
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
24
backend/main.py
Normal file
24
backend/main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from routers import eggs, flock, feed, stats
|
||||
|
||||
app = FastAPI(title="Eggtracker API")
|
||||
|
||||
# Allow requests from the Nginx frontend (same host, different port internally)
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
app.include_router(eggs.router)
|
||||
app.include_router(flock.router)
|
||||
app.include_router(feed.router)
|
||||
app.include_router(stats.router)
|
||||
|
||||
|
||||
@app.get("/api/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
Reference in New Issue
Block a user