Spaces:
Running
Running
File size: 829 Bytes
4117d38 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
from fastapi import FastAPI
from server.utils import config
from getNode import router as GetNodeRouter
from randomSubscribeUrl import router as randomSubscribeUrlRouter
from validSubCount import router as validSubCountRouter
import uvicorn
app = FastAPI()
fileName = "subscribeLink.txt"
randomSubscribeUrlRouter.fileName = fileName
validSubCountRouter.fileName = fileName
GetNodeRouter.fileName = fileName
@app.get("/uu.json", tags=["Root"])
async def read_root() -> dict:
return config
#全局路由
app.include_router(GetNodeRouter, prefix="/getNode")
app.include_router(randomSubscribeUrlRouter, prefix="/randomSubscribeUrl")
app.include_router(validSubCountRouter, prefix="/validSubCount")
#这个是部署hf上
if __name__ == '__main__':
uvicorn.run(app, host='0.0.0.0', port=7860)
|