deploy: update habadashi_login
Browse files
app.py
CHANGED
|
@@ -21,6 +21,7 @@ logging.getLogger("uvicorn.access").addFilter(_SuppressGet200Filter())
|
|
| 21 |
from pathlib import Path
|
| 22 |
from fastapi import FastAPI, Request, Depends, HTTPException
|
| 23 |
from fastapi.responses import RedirectResponse, JSONResponse
|
|
|
|
| 24 |
from starlette.middleware.base import BaseHTTPMiddleware
|
| 25 |
import gradio as gr
|
| 26 |
from supabase import create_client, Client
|
|
@@ -90,6 +91,10 @@ except Exception as e:
|
|
| 90 |
print("[PHASE] fastapi_init_start")
|
| 91 |
app = FastAPI()
|
| 92 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
print("[PHASE] fastapi_init_end")
|
| 94 |
|
| 95 |
# user_id -> profile dict のキャッシュ(プロセス内で保持、ログイン情報は変わらない前提)
|
|
|
|
| 21 |
from pathlib import Path
|
| 22 |
from fastapi import FastAPI, Request, Depends, HTTPException
|
| 23 |
from fastapi.responses import RedirectResponse, JSONResponse
|
| 24 |
+
from fastapi.staticfiles import StaticFiles
|
| 25 |
from starlette.middleware.base import BaseHTTPMiddleware
|
| 26 |
import gradio as gr
|
| 27 |
from supabase import create_client, Client
|
|
|
|
| 91 |
print("[PHASE] fastapi_init_start")
|
| 92 |
app = FastAPI()
|
| 93 |
|
| 94 |
+
# /static で静的ファイルを配信(logo.png などのアセット用)
|
| 95 |
+
_static_dir = Path(__file__).parent
|
| 96 |
+
app.mount("/static", StaticFiles(directory=str(_static_dir)), name="static")
|
| 97 |
+
|
| 98 |
print("[PHASE] fastapi_init_end")
|
| 99 |
|
| 100 |
# user_id -> profile dict のキャッシュ(プロセス内で保持、ログイン情報は変わらない前提)
|