25 lines
496 B
Python
25 lines
496 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api.qr import router as qr_router
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
app = FastAPI(title="QR Code Service")
|
|
|
|
# Open CORS to all origins
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(qr_router, prefix="/api/qrcode")
|
|
|
|
return app
|
|
|
|
|
|
app = create_app()
|