2024-04-06 20:19:45 +00:00
|
|
|
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
|
|
|
|
2024-04-06 20:19:45 +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=['*']
|
|
|
|
)
|
|
|
|
|
2024-04-06 20:19:45 +00:00
|
|
|
models.Base.metadata.create_all(bind=engine)
|
2024-04-05 23:28:27 +00:00
|
|
|
|
2024-04-06 20:19:45 +00:00
|
|
|
app.include_router(forum.router)
|
|
|
|
app.include_router(auth.router)
|