fix(api): Fixed the way of running the app

This commit is contained in:
SWHL committed 2024-08-19 09:27:13 +08:00
1 parent 868e75f8de
commit b1983832eb
1 file changed
+1 -4
+1 -4
View File
@@ -71,10 +71,7 @@ def main():
parser.add_argument("-p", "--port", type=int, default=9003, help="IP port")
args = parser.parse_args()
cur_file_path = Path(__file__).resolve()
app_path = f"{cur_file_path.parent.name}.{cur_file_path.stem}:app"
print(app_path)
uvicorn.run(app_path, host=args.ip, port=args.port, reload=True)
uvicorn.run("api:app", host=args.ip, port=args.port, reload=True)
if __name__ == "__main__":