balance-application/app.py
2024-09-11 01:42:29 +09:00

22 lines
503 B
Python

from fastapi import FastAPI, Response
from routes.auth import router as auth
from routes.balance import router as balance
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"]
)
@app.get("/")
def index(resp: Response):
resp.headers.setdefault("Content-Type", "text")
return "Hello, World!"
app.include_router(router=auth)
app.include_router(router=balance)