fastapi-boilerplate/app/main.py

19 lines
353 B
Python
Raw Normal View History

2023-08-10 22:46:36 +02:00
from fastapi import Depends, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from sqlalchemy.orm import Session
import crud
from api.api import api_router
2023-08-10 22:46:36 +02:00
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"]
)
app.include_router(api_router)
2023-08-10 22:46:36 +02:00
@app.get("/")
async def root():
return {"message": "Hello World"}