Files
mock-server/main.py
2025-12-25 21:07:25 +08:00

18 lines
469 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from fastapi import FastAPI
from fastapi.responses import FileResponse
import json
app = FastAPI(title="Mock Server", version="1.0")
@app.get("/v1/models")
async def get_models():
return FileResponse('models.json', media_type='application/json')
if __name__ == "__main__":
import uvicorn
# 3000端口推荐
uvicorn.run(app, host="0.0.0.0", port=80)
# 80端口需要管理员权限
# uvicorn.run(app, host="0.0.0.0", port=80)