mirror of
https://github.com/laramies/theHarvester.git
synced 2024-11-10 09:02:37 +08:00
add auto reload support to the restapi launcher
This commit is contained in:
parent
b28747c76a
commit
ce419a14d4
1 changed files with 4 additions and 4 deletions
|
@ -1,14 +1,14 @@
|
|||
#!/usr/bin/env python3
|
||||
import uvicorn
|
||||
import theHarvester.lib.api.api as api
|
||||
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')
|
||||
parser.add_argument('-p', '--port', default=5000, help='Port to bind the web server to, default is 5000')
|
||||
parser.add_argument('-p', '--port', default=5000, help='Port to bind the web server to, default is 5000', type=int)
|
||||
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')
|
||||
parser.add_argument('-r', '--reload', default=False, help='Enable automatic reload used during development of the api', action='store_true')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app=api.app, host=args.host, port=args.port, log_level=args.log_level)
|
||||
if __name__ == '__main__':
|
||||
uvicorn.run('theHarvester.lib.api.api:app', host=args.host, port=args.port, log_level=args.log_level, reload=args.reload)
|
||||
|
|
Loading…
Reference in a new issue