123456789101112 |
- import uvicorn
- import argparse
- if __name__ == '__main__':
- parser = argparse.ArgumentParser()
- parser.add_argument('--host', default='0.0.0.0')
- parser.add_argument('--port', default=8000)
- opt = parser.parse_args()
- app_str = 'delete:app' # make the app string equal to whatever the name of this file is
- uvicorn.run(app_str, host=opt.host, port=int(opt.port), reload=True)
|