2021-04-06 08:42:10 +08:00
#!/usr/bin/env python3
import uvicorn
import argparse
parser = argparse . ArgumentParser ( )
parser . add_argument ( ' -H ' , ' --host ' , default = ' 127.0.0.1 ' , help = ' IP address to listen on default is 127.0.0.1 ' )
2021-05-12 08:40:44 +08:00
parser . add_argument ( ' -p ' , ' --port ' , default = 5000 , help = ' Port to bind the web server to, default is 5000 ' , type = int )
2021-04-06 08:42:10 +08:00
parser . add_argument ( ' -l ' , ' --log-level ' , default = ' info ' , help = ' Set logging level, default is info but [critical|error|warning|info|debug|trace] can be set ' )
2021-05-12 08:40:44 +08:00
parser . add_argument ( ' -r ' , ' --reload ' , default = False , help = ' Enable automatic reload used during development of the api ' , action = ' store_true ' )
2021-04-06 08:42:10 +08:00
args = parser . parse_args ( )
2021-05-12 08:40:44 +08:00
if __name__ == ' __main__ ' :
uvicorn . run ( ' theHarvester.lib.api.api:app ' , host = args . host , port = args . port , log_level = args . log_level , reload = args . reload )