123456789101112131415161718192021 |
- import os
- import uvicorn
- from fastapi import FastAPI
- app = FastAPI(title="project name ", description="通用系统 ", version="v 0.0.0")
- @app.get("/call_sh")
- def call_sh(path: str):
- os.system(f"sh {path} &")
- return "请等待结果"
- @app.get("/")
- def call_sh():
- return {"code": 200}
- if __name__ == '__main__':
- uvicorn.run(app='tmp3:app', host="0.0.0.0", port=9990, reload=True)
|