- Add admin auth dependency and role checks - Expand channel and restaurant API routes - Improve YouTube transcript fetching - Enhance daemon worker with better error handling and scheduling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
"""FastAPI application entry point."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from api.routes import restaurants, channels, videos, search, auth, reviews, admin_users, stats, daemon
|
|
|
|
app = FastAPI(
|
|
title="Tasteby API",
|
|
description="YouTube restaurant map service API",
|
|
version="0.1.0",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["http://localhost:3000", "http://localhost:3001"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(restaurants.router, prefix="/api/restaurants", tags=["restaurants"])
|
|
app.include_router(channels.router, prefix="/api/channels", tags=["channels"])
|
|
app.include_router(videos.router, prefix="/api/videos", tags=["videos"])
|
|
app.include_router(search.router, prefix="/api/search", tags=["search"])
|
|
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
|
app.include_router(reviews.router, prefix="/api", tags=["reviews"])
|
|
app.include_router(admin_users.router, prefix="/api/admin/users", tags=["admin-users"])
|
|
app.include_router(stats.router, prefix="/api/stats", tags=["stats"])
|
|
app.include_router(daemon.router, prefix="/api/daemon", tags=["daemon"])
|
|
|
|
|
|
@app.get("/api/health")
|
|
def health():
|
|
return {"status": "ok"}
|