19 lines
431 B
Python
19 lines
431 B
Python
import logging
|
|
|
|
from app.infrastructure.database.database import init_db
|
|
from fastapi import FastAPI
|
|
from starlette.middleware.cors import CORSMiddleware
|
|
|
|
logging.basicConfig(level=logging.INFO)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
app = FastAPI()
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=['*'],
|
|
allow_credentials=True,
|
|
allow_methods=['GET', 'POST', 'PUT', 'DELETE'],
|
|
allow_headers=['*'],
|
|
)
|
|
|
|
init_db() |