from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from routers import auth from fastapi.responses import HTMLResponse app = FastAPI(title="Auth Service") # Cấu hình CORS app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Gắn router vào app app.include_router(auth.router, prefix="/auth", tags=["Authentication"]) @app.get("/") def root(): return {"message": "Auth Service is running!"} # Endpoint hiển thị giao diện Đặt lại mật khẩu @app.get("/reset-password", response_class=HTMLResponse) async def serve_reset_password_page(token: str): return f""" Đặt lại mật khẩu

Tạo mật khẩu mới

""" if __name__ == "__main__": import uvicorn uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)