-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (29 loc) · 926 Bytes
/
app.py
File metadata and controls
38 lines (29 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import sentry_sdk
from sentry_sdk.integrations.fastapi import FastApiIntegration
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from core.db import Base, engine
from core.routes import blog_router, media_router, auth_router # Import routers
Base.metadata.create_all(engine)
app = FastAPI(
title="Readre Blog API",
description="api documentation for Readre",
version="1.0.0"
)
origins = ["http://localhost:3000", "https://readre.vercel.app"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(blog_router)
app.include_router(media_router)
app.include_router(auth_router)
@app.get("/")
async def health_check():
return {"detail;":"welcome to the readre blog API",
"docs":"check /docs for documentation",
"status":"ok"
}