You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
imaginAIry/imaginairy/cli/run_api.py

19 lines
439 B
Python

import logging
import click
logger = logging.getLogger(__name__)
@click.command("run-server")
def run_server_cmd():
"""Run a HTTP API server."""
import uvicorn
from imaginairy.http.app import app
from imaginairy.log_utils import configure_logging
configure_logging(level="DEBUG")
logger.info("Starting HTTP API server at http://0.0.0.0:8000")
uvicorn.run(app, host="0.0.0.0", port=8000, log_level="info")