Skip to content

Commit e537c8c

Browse files
Neeraj SirdeshmukhNeeraj Sirdeshmukh
authored andcommitted
Add proper rel type and version of Stac API
1 parent ba34978 commit e537c8c

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

CHANGELOG.md

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

88
## [0.5.0] - 2022-05-18
99

10+
### Added
11+
12+
- Added STAC_API_VERSION as an environment variable to the serverless.yml file
13+
- Added STAC_API_VERSION to display on the API landing page within the api.js file
14+
under src/lib/api.js in the collectionsToCatalogLinks function
15+
16+
### Changed
17+
18+
- Changed the rel type to 'server' for the URL to the STAC API webpage inside the Links object
19+
1020
### Removed
1121

1222
- Removed the failed-ingest Lambda function from the serverless.yml file since this function is no longer needed

serverless.yml.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ provider:
99
STAC_ID: "stac-server"
1010
STAC_TITLE: "STAC API"
1111
STAC_DESCRIPTION: "A STAC API using stac-server"
12+
STAC_API_VERSION: "1.0.0-beta.5"
1213
STAC_VERSION: 1.0.0
1314
LOG_LEVEL: DEBUG
1415
ES_BATCH_SIZE: 500

src/lib/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,13 @@ const addItemLinks = function (results, endpoint) {
365365

366366
const collectionsToCatalogLinks = function (results, endpoint) {
367367
const stacVersion = process.env.STAC_VERSION || '1.0.0'
368+
const stacApiVersion = process.env.STAC_API_VERSION || '1.0.0-beta.5'
368369
const catalogId = process.env.STAC_ID || 'stac-server'
369370
const catalogTitle = process.env.STAC_TITLE || 'A STAC API'
370371
const catalogDescription = process.env.STAC_DESCRIPTION || 'A STAC API running on stac-server'
371372
const catalog = {
372373
stac_version: stacVersion,
374+
stac_api_version: stacApiVersion,
373375
type: 'Catalog',
374376
id: catalogId,
375377
title: catalogTitle,
@@ -583,7 +585,7 @@ const getCatalog = async function (txnEnabled, backend, endpoint = '') {
583585
const docsUrl = process.env.STAC_DOCS_URL
584586
if (docsUrl) {
585587
links.push({
586-
rel: 'docs',
588+
rel: 'server',
587589
href: docsUrl,
588590
type: 'text/html'
589591
})

0 commit comments

Comments
 (0)