forum-app/backend/main.py

22 lines
439 B
Python
Raw Permalink Normal View History

from fastapi import FastAPI
2024-04-06 22:29:56 +00:00
from fastapi.middleware.cors import CORSMiddleware
2024-04-05 23:01:15 +00:00
import models
from database import engine
from routers import auth, forum
2024-04-05 23:01:15 +00:00
app = FastAPI()
2024-04-06 22:29:56 +00:00
app.add_middleware(
CORSMiddleware,
allow_origins=['*'],
allow_credentials=False,
allow_methods=['GET', 'POST'],
allow_headers=['*']
)
models.Base.metadata.create_all(bind=engine)
2024-04-05 23:28:27 +00:00
app.include_router(forum.router)
app.include_router(auth.router)