22 lines
439 B
Python
22 lines
439 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
import models
|
|
from database import engine
|
|
from routers import auth, forum
|
|
|
|
app = FastAPI()
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=['*'],
|
|
allow_credentials=False,
|
|
allow_methods=['GET', 'POST'],
|
|
allow_headers=['*']
|
|
)
|
|
|
|
models.Base.metadata.create_all(bind=engine)
|
|
|
|
app.include_router(forum.router)
|
|
app.include_router(auth.router)
|