Skip to content

Commit 116832b

Browse files
Merge pull request #44 from developmentseed/fix/healthz-endpoint
fix healthz endpoint and update changelog
2 parents 685612c + e8d9211 commit 116832b

3 files changed

Lines changed: 26 additions & 37 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
## [Unreleased]
44

55
* update titiler requirements to `>=1.0,<1.1`
6+
* add support for python 3.14
7+
* update type hints for python >=3.11
8+
* move and rename `titiler.stacapi.backend.CustomSTACReader` to `titiler.stacapi.reader.SimpleSTACReader`
9+
* delete `utils` sub-module (utility functions have been moved to `titiler.core`)
10+
* rename `titiler.stacapi.reader.STACReader` to `STACAPIReader`
11+
* add `ids`, `filter-lang` and `filter` parameters to collection's queries
12+
* refactor `STACAPIBackend` to use rio-tiler's mosaic backend
13+
* add `/conformance` endpoint
14+
* replace `/debug` endpoint by `/healthz`
15+
* add more links to the landing page
16+
* add WMTS extensions to the Items and Collections endpoints
17+
* remove custom `MosaicTilerFactory` and default to the one from `titiler.mosaic`
618

719
## [0.4.0] - 2025-11-06
820

tests/test_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_docs(app):
7979

8080
def test_debug(app):
8181
"""Test / endpoint."""
82-
response = app.get("/debug")
82+
response = app.get("/healthz")
8383
assert response.status_code == 200
8484
assert response.headers["content-type"] == "application/json"
8585
body = response.json()

titiler/stacapi/main.py

Lines changed: 13 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
import morecantile
88
import rasterio
99
from fastapi import FastAPI, Query
10+
from fastapi import __version__ as fastapi_version
1011
from fastapi.responses import ORJSONResponse
1112
from morecantile import TileMatrixSets
13+
from pydantic import __version__ as pydantic_version
14+
from rio_tiler import __version__ as rio_tiler_version
15+
from starlette import __version__ as starlette_version
1216
from starlette.middleware.cors import CORSMiddleware
1317
from starlette.requests import Request
1418
from starlette.templating import Jinja2Templates
@@ -375,57 +379,30 @@ def conformance(
375379
###############################################################################
376380
# Health Check Endpoint
377381
@app.get("/healthz", description="Health Check", tags=["Health Check"])
378-
def ping() -> dict:
382+
def ping(request: Request) -> dict:
379383
"""Health check."""
380384
try:
381385
resp = httpx.get(app.state.stac_url)
382386
api_online = True if resp.status_code == 200 else False
383387
except: # noqa
384388
api_online = False
385389

386-
return {
390+
data = {
387391
"stac-api_online": api_online,
388392
"versions": {
389393
"titiler": titiler_version,
390394
"titiler.stacapi": titiler_stacapi_version,
391395
"rasterio": rasterio.__version__,
396+
"rio-tiler": rio_tiler_version,
392397
"gdal": rasterio.__gdal_version__,
393398
"proj": rasterio.__proj_version__,
394-
"geos": rasterio.__geos_version__,
399+
"fastapi": fastapi_version,
400+
"starlette": starlette_version,
401+
"pydantic": pydantic_version,
395402
},
396403
}
397404

405+
if settings.debug:
406+
data["url"] = request.app.state.stac_url
398407

399-
if settings.debug:
400-
401-
@app.get("/debug", include_in_schema=False, tags=["DEBUG"])
402-
def debug(request: Request) -> dict:
403-
"""APP Info."""
404-
405-
import rasterio
406-
from fastapi import __version__ as fastapi_version
407-
from pydantic import __version__ as pydantic_version
408-
from rio_tiler import __version__ as rio_tiler_version
409-
from starlette import __version__ as starlette_version
410-
411-
try:
412-
resp = httpx.get(app.state.stac_url)
413-
api_online = True if resp.status_code == 200 else False
414-
except: # noqa
415-
api_online = False
416-
417-
return {
418-
"url": request.app.state.stac_url,
419-
"stac-api_online": api_online,
420-
"versions": {
421-
"titiler.stacapi": titiler_stacapi_version,
422-
"titiler.core": titiler_version,
423-
"rio-tiler": rio_tiler_version,
424-
"rasterio": rasterio.__version__,
425-
"gdal": rasterio.__gdal_version__,
426-
"proj": rasterio.__proj_version__,
427-
"fastapi": fastapi_version,
428-
"starlette": starlette_version,
429-
"pydantic": pydantic_version,
430-
},
431-
}
408+
return data

0 commit comments

Comments
 (0)