make a media api, encapsulate the original S3 bucket address
there are 3 parts, from back to head, url inside the bucket -> url of backend media api -> backend domain, only the last part is spliced by frontend, the other two parts are spliced with sqlalchemy
This commit is contained in:
@@ -6,6 +6,7 @@ from strawberry.fastapi import GraphQLRouter
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from auth import router as auth_router
|
||||
from app.media.router import router as media_router
|
||||
|
||||
from app.db import engine, SessionLocal
|
||||
from app.models import Base, User
|
||||
@@ -44,6 +45,7 @@ graphql_router = GraphQLRouter(schema, context_getter=get_context)
|
||||
|
||||
# 挂载路由
|
||||
app.include_router(auth_router) # 保留现有的 auth 路由供 Google OAuth 回调使用
|
||||
app.include_router(media_router) # 挂载媒体路由,提供头像代理访问等等
|
||||
app.include_router(graphql_router, prefix="/graphql") # 挂载 GraphQL 终点,前端以后只需要请求 /graphql
|
||||
|
||||
# 打印路由测试
|
||||
|
||||
Reference in New Issue
Block a user