Skip to content

rs_server_catalog/main.md

<< Back to index

RS-Server STAC catalog based on stac-fastapi-pgstac.

run()

Run app from command line using uvicorn if available.

Source code in docs/rs-server/services/catalog/rs_server_catalog/main.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def run():
    """Run app from command line using uvicorn if available."""
    try:
        import uvicorn  # pylint: disable=import-outside-toplevel

        uvicorn.run(
            "rs_server_catalog.app:app",
            host=settings.app_host,
            port=settings.app_port,
            log_level="info",
            reload=settings.reload,
            root_path=os.getenv("UVICORN_ROOT_PATH", ""),
        )
    except ImportError:
        raise RuntimeError("Uvicorn must be installed in order to use command")  # pylint: disable=raise-missing-from