Spaces:
Running
Running
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 | |
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) | |