Skip to content

Commit 0c7cfcd

Browse files
authored
Merge pull request #207 from stac-utils/206-api-info
Enable custom API title and description
2 parents 666f980 + b69e983 commit 0c7cfcd

File tree

6 files changed

+26
-2
lines changed

6 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
### Added
1111

12+
- 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)
13+
1214
### Changed
1315

1416
### Fixed

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ services:
99
context: .
1010
dockerfile: dockerfiles/Dockerfile.dev.es
1111
environment:
12+
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
13+
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
14+
- STAC_FASTAPI_VERSION=2.1
1215
- APP_HOST=0.0.0.0
1316
- APP_PORT=8080
1417
- RELOAD=true
@@ -38,6 +41,9 @@ services:
3841
context: .
3942
dockerfile: dockerfiles/Dockerfile.dev.os
4043
environment:
44+
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
45+
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46+
- STAC_FASTAPI_VERSION=2.1
4147
- APP_HOST=0.0.0.0
4248
- APP_PORT=8082
4349
- RELOAD=true

stac_fastapi/elasticsearch/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
# Requirements
1+
# stac-fastapi-elasticsearch
2+
3+
## Requirements
24

35
The Elasticsearch backend requires **elasticsearch**.

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""FastAPI application."""
22

3+
import os
4+
35
from stac_fastapi.api.app import StacApi
46
from stac_fastapi.api.models import create_get_request_model, create_post_request_model
57
from stac_fastapi.core.core import (
@@ -60,6 +62,9 @@
6062
post_request_model = create_post_request_model(extensions)
6163

6264
api = StacApi(
65+
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
66+
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
67+
api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"),
6368
settings=settings,
6469
extensions=extensions,
6570
client=CoreClient(

stac_fastapi/opensearch/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
# stac-fastapi-opensearch
1+
# stac-fastapi-opensearch
2+
3+
## Requirements
4+
5+
The Opensearch backend requires **opensearch**.

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""FastAPI application."""
22

3+
import os
4+
35
from stac_fastapi.api.app import StacApi
46
from stac_fastapi.api.models import create_get_request_model, create_post_request_model
57
from stac_fastapi.core.core import (
@@ -60,6 +62,9 @@
6062
post_request_model = create_post_request_model(extensions)
6163

6264
api = StacApi(
65+
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-opensearch"),
66+
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-opensearch"),
67+
api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"),
6368
settings=settings,
6469
extensions=extensions,
6570
client=CoreClient(

0 commit comments

Comments
 (0)