diff --git a/CHANGELOG.md b/CHANGELOG.md index 63e8b796..5f32cea9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added +- Added API `title`, `version`, and `description` parameters from environment variables `STAC_FASTAPI_TITLE`, `STAC_FASTAPI_VERSION` and `STAC_FASTAPI_DESCRIPTION`, respectively. [#207](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/207) + ### Changed ### Fixed diff --git a/docker-compose.yml b/docker-compose.yml index ee6e995f..8b5e2f07 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,9 @@ services: context: . dockerfile: dockerfiles/Dockerfile.dev.es environment: + - STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch + - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend + - STAC_FASTAPI_VERSION=2.1 - APP_HOST=0.0.0.0 - APP_PORT=8080 - RELOAD=true @@ -38,6 +41,9 @@ services: context: . dockerfile: dockerfiles/Dockerfile.dev.os environment: + - STAC_FASTAPI_TITLE=stac-fastapi-opensearch + - STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend + - STAC_FASTAPI_VERSION=2.1 - APP_HOST=0.0.0.0 - APP_PORT=8082 - RELOAD=true diff --git a/stac_fastapi/elasticsearch/README.md b/stac_fastapi/elasticsearch/README.md index becdb4d7..85e9dd1d 100644 --- a/stac_fastapi/elasticsearch/README.md +++ b/stac_fastapi/elasticsearch/README.md @@ -1,3 +1,5 @@ -# Requirements +# stac-fastapi-elasticsearch + +## Requirements The Elasticsearch backend requires **elasticsearch**. diff --git a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py index 0d896534..6f204ed8 100644 --- a/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py +++ b/stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py @@ -1,5 +1,7 @@ """FastAPI application.""" +import os + from stac_fastapi.api.app import StacApi from stac_fastapi.api.models import create_get_request_model, create_post_request_model from stac_fastapi.core.core import ( @@ -60,6 +62,9 @@ post_request_model = create_post_request_model(extensions) api = StacApi( + title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"), + description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"), + api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"), settings=settings, extensions=extensions, client=CoreClient( diff --git a/stac_fastapi/opensearch/README.md b/stac_fastapi/opensearch/README.md index 6b1f8391..2b1e991f 100644 --- a/stac_fastapi/opensearch/README.md +++ b/stac_fastapi/opensearch/README.md @@ -1 +1,5 @@ -# stac-fastapi-opensearch \ No newline at end of file +# stac-fastapi-opensearch + +## Requirements + +The Opensearch backend requires **opensearch**. \ No newline at end of file diff --git a/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py b/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py index ebb2921e..79a95a90 100644 --- a/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py +++ b/stac_fastapi/opensearch/stac_fastapi/opensearch/app.py @@ -1,5 +1,7 @@ """FastAPI application.""" +import os + from stac_fastapi.api.app import StacApi from stac_fastapi.api.models import create_get_request_model, create_post_request_model from stac_fastapi.core.core import ( @@ -60,6 +62,9 @@ post_request_model = create_post_request_model(extensions) api = StacApi( + title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-opensearch"), + description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-opensearch"), + api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"), settings=settings, extensions=extensions, client=CoreClient(