Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.24 KB

File metadata and controls

49 lines (35 loc) · 1.24 KB

Usage with Litestar

Another example of usage with LiteStar - litestar-sqlalchemy-template

1. Install lite-bootstrap[litestar-all]:

=== "uv"

  ```bash
  uv add lite-bootstrap[litestar-all]
  ```

=== "pip"

  ```bash
  pip install lite-bootstrap[litestar-all]
  ```

=== "poetry"

  ```bash
  poetry add lite-bootstrap[litestar-all]
  ```

Read more about available extras here:

2. Define bootstrapper config and build you application:

from lite_bootstrap import LitestarConfig, LitestarBootstrapper


bootstrapper_config = LitestarConfig(
    service_name="microservice",
    service_version="2.0.0",
    service_environment="test",
    service_debug=False,
    cors_allowed_origins=["http://test"],
    health_checks_path="/custom-health/",
    opentelemetry_endpoint="otl",
    prometheus_metrics_path="/custom-metrics/",
    sentry_dsn="https://testdsn@localhost/1",
    swagger_offline_docs=True,
)
bootstrapper = LitestarBootstrapper(bootstrapper_config)
application = bootstrapper.bootstrap()

Read more about available configuration options here: