run.py 404 B

1234567891011
  1. if __name__ == '__main__':
  2. import uvicorn
  3. import argparse
  4. parser = argparse.ArgumentParser()
  5. parser.add_argument('--host', default='0.0.0.0')
  6. parser.add_argument('--port', default=8080)
  7. opt = parser.parse_args()
  8. app_str = 'server:app' # make the app string equal to whatever the name of this file is
  9. uvicorn.run(app_str, host=opt.host, port=int(opt.port), reload=True)