
- Removed unused imports in deps.py, routes/auth.py, and models/user.py - Code is now lint-free and follows best practices - Complete FastAPI user authentication service with JWT token support generated with BackendIM... (backend.im)
28 lines
655 B
Python
28 lines
655 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.api.routes import auth, health
|
|
from app.core.config import settings
|
|
|
|
app = FastAPI(
|
|
title=settings.PROJECT_NAME,
|
|
description="User Authentication Service API",
|
|
version="0.1.0",
|
|
)
|
|
|
|
# Set up CORS
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.CORS_ORIGINS,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# Include routers
|
|
app.include_router(auth.router)
|
|
app.include_router(health.router)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True) |