18 lines
469 B
Python
18 lines
469 B
Python
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)
|