已有认证识别基本功能,暂未支持高并发
This commit is contained in:
22
app/main.py
Normal file
22
app/main.py
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
from fastapi import FastAPI
|
||||
from .api import router as api_router
|
||||
from .database import initialize_database
|
||||
|
||||
app = FastAPI(
|
||||
title="人脸识别服务 V2",
|
||||
description="一个健壮、可靠的人脸识别与认证API服务。",
|
||||
version="2.0.0"
|
||||
)
|
||||
|
||||
@app.on_event("startup")
|
||||
def on_startup():
|
||||
"""应用启动时,初始化数据库"""
|
||||
initialize_database()
|
||||
|
||||
# 挂载API路由
|
||||
app.include_router(api_router, prefix="/api", tags=["Face Recognition"])
|
||||
|
||||
@app.get("/", summary="服务健康检查")
|
||||
def read_root():
|
||||
return {"status": "ok", "message": "欢迎使用人脸识别服务 V2"}
|
Reference in New Issue
Block a user