WSGI compatible (allow gunicorn use)

This commit is contained in:
Corentin 2025-10-23 18:11:50 +09:00
commit 4e89dde75f
3 changed files with 28 additions and 19 deletions

23
start.py Normal file
View file

@ -0,0 +1,23 @@
from argparse import ArgumentParser
from server import create_app
def main():
parser = ArgumentParser()
parser.add_argument('--host', default='0.0.0.0', help='Server host (default: 0.0.0.0)')
parser.add_argument('--port', type=int, default=8000, help='Server port (default: 8000)')
parser.add_argument('--debug', action='store_true', help='Run in debug mode (auto-reload on change)')
arguments = parser.parse_args()
host: str = arguments.host
port: int = arguments.port
debug_mode: bool = arguments.debug
del arguments
app = create_app(debug_mode=debug_mode)
app.run(host=host, port=port, debug=debug_mode)
if __name__ == '__main__':
main()