Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable custom API title and description #207

Merged
merged 8 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added

- Added API `title` and `description` parameters from environment variables `STAC_API_TITLE` and `STAC_API_DESCRIPTION`, respectively. [#207](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/207)

### Changed

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion stac_fastapi/elasticsearch/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Requirements
# stac-fastapi-elasticsearch

## Requirements

The Elasticsearch backend requires **elasticsearch**.
4 changes: 4 additions & 0 deletions stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -60,6 +62,8 @@
post_request_model = create_post_request_model(extensions)

api = StacApi(
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi"),
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi"),
Copy link
Collaborator

@jonhealy1 jonhealy1 Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include the STAC_FASTAPI_VERSION from the pr in stac-fastapi? api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1")) Also, should these have more specific default values? The title here for instance could be stac-fastapi.elasticsearch. The api version would be 2.1. If we could pull the default version in from the version file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good call. I will make those changes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add the new env vars to the app-opensearch and app-elasticsearch in the docker-compose.yml file too. It might help people realize that they can change those things.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Added that as well

settings=settings,
extensions=extensions,
client=CoreClient(
Expand Down
6 changes: 5 additions & 1 deletion stac_fastapi/opensearch/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# stac-fastapi-opensearch
# stac-fastapi-opensearch

## Requirements

The Opensearch backend requires **opensearch**.
4 changes: 4 additions & 0 deletions stac_fastapi/opensearch/stac_fastapi/opensearch/app.py
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down Expand Up @@ -60,6 +62,8 @@
post_request_model = create_post_request_model(extensions)

api = StacApi(
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi"),
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi"),
settings=settings,
extensions=extensions,
client=CoreClient(
Expand Down