balance-application/app.py

23 lines
503 B
Python
Raw Normal View History

2024-09-10 13:14:09 +09:00
from fastapi import FastAPI, Response
2024-09-10 14:20:11 +09:00
from routes.auth import router as auth
from routes.balance import router as balance
2024-09-10 21:20:03 +09:00
from fastapi.middleware.cors import CORSMiddleware
2024-09-10 10:31:17 +09:00
app = FastAPI()
2024-09-10 21:20:03 +09:00
app.add_middleware(
CORSMiddleware,
2024-09-10 21:23:22 +09:00
allow_origins=["*"],
2024-09-10 21:22:01 +09:00
allow_credentials=True,
2024-09-11 01:42:29 +09:00
allow_methods=["*"],
2024-09-10 21:20:03 +09:00
allow_headers=["*"]
)
2024-09-10 13:14:09 +09:00
@app.get("/")
def index(resp: Response):
resp.headers.setdefault("Content-Type", "text")
2024-09-10 10:31:17 +09:00
return "Hello, World!"
2024-09-10 14:20:11 +09:00
app.include_router(router=auth)
app.include_router(router=balance)