Skip to content

Commit cc75b4b

Browse files
STAC_FASTAPI_ROOT_PATH env var and readme
1 parent 0ac4d2f commit cc75b4b

File tree

3 files changed

+9
-0
lines changed
  • stac_fastapi
    • elasticsearch/stac_fastapi/elasticsearch
    • opensearch/stac_fastapi/opensearch

3 files changed

+9
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ curl -X "POST" "http://localhost:8080/collections" \
8282

8383
Note: this "Collections Transaction" behavior is not part of the STAC API, but may be soon.
8484

85+
## Configure the API
86+
87+
By default the API title and description are set to `stac-fastapi-<backend>`. Change the API title and description from the default by setting the `STAC_FASTAPI_TITLE` and `STAC_FASTAPI_DESCRIPTION` environment variables, respectively.
88+
89+
By default the API will read from and write to the `collections` and `items_<collection name>` indices. To change the API collections index and the items index prefix, change the `STAC_COLLECTIONS_INDEX` and `STAC_ITEMS_INDEX_PREFIX` environment variables.
90+
91+
The application root path is left as the base url by default. If deploying to AWS Lambda with a Gateway API, you will need to define the app root path to be the same as the Gateway API stage name where you will deploy the API. The app root path can be defined with the `STAC_FASTAPI_ROOT_PATH` environment variable (`/v1`, for example)
8592

8693
## Collection pagination
8794

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
search_post_request_model=post_request_model,
7676
)
7777
app = api.app
78+
app.root_path = os.getenv("STAC_FASTAPI_ROOT_PATH", "")
7879

7980

8081
@app.on_event("startup")

stac_fastapi/opensearch/stac_fastapi/opensearch/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
search_post_request_model=post_request_model,
7676
)
7777
app = api.app
78+
app.root_path = os.getenv("STAC_FASTAPI_ROOT_PATH", "")
7879

7980

8081
@app.on_event("startup")

0 commit comments

Comments
 (0)