Skip to content

Commit

Permalink
Run API server using host and port values from configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Marta Gómez Macías committed Feb 19, 2019
1 parent f1d79c3 commit 4d6660f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/scripts/wazuh-apid.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ def read_config():
return configuration


def main():
def main(configuration):
app = connexion.App(__name__, specification_dir=f'{common.ossec_path}/api/api/spec/')
app.app.json_encoder = encoder.JSONEncoder
app.add_api('spec.yaml', arguments={'title': 'Wazuh API'})
app.run(port=8080)
app.run(port=configuration['port'], host=configuration['host'])


#
Expand Down Expand Up @@ -130,6 +131,6 @@ def main():
pyDaemonModule.create_pid('wazuh-apid', os.getpid())

try:
main()
main(configuration)
except KeyboardInterrupt:
main_logger.info("SIGINT received. Bye!")

0 comments on commit 4d6660f

Please sign in to comment.