anyalerob commited on
Commit
f3607b4
·
verified ·
1 Parent(s): b2062d3

Create main.py

Browse files
Files changed (1) hide show
  1. main.py +20 -0
main.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # main.py
2
+ # 主应用入口
3
+
4
+ from fastapi import FastAPI
5
+ from routes import router
6
+
7
+ # 创建FastAPI应用
8
+ app = FastAPI()
9
+
10
+ # 注册路由
11
+ app.include_router(router)
12
+
13
+ # 添加健康检查路由
14
+ @app.get("/health")
15
+ async def health_check():
16
+ return {"status": "ok"}
17
+
18
+ if __name__ == "__main__":
19
+ import uvicorn
20
+ uvicorn.run(app, host="0.0.0.0", port=8080)