""" /app.py """

# this starts the werkzeug server for debugging server on windows. It is not used
# in production, and for debugging takes the place of the WSGI under Apache

import os
from multiprocessing import Process

import mgmt


def run_words_service():
    """Start the words_service Flask app in a separate process."""
    os.system("python service/words_service.py")


if __name__ == "__main__":

    with mgmt.app.app_context():
        process = Process(target=run_words_service)
        process.daemon = True  # Ensure it stops when the main app exits
        process.start()

    mgmt.app.run(host="0.0.0.0", debug=False, threaded=False)
