Skip to content

Commit

Permalink
fix: update stac viewer endpoint value (#311)
Browse files Browse the repository at this point in the history
### Issue
#291

### What?

- Updated the endpoint value for the STAC viewer in order to properly
render the collections on the webpage.
- Added a PR template so that all new PRs will have a template for
reference

### Why?

- The endpoint is https://dev.openveda.cloud/collections which is
incorrect which causes the collections filter to fail in the STAC
viewer.


https://github.com/NASA-IMPACT/veda-backend/assets/12633533/b272fb4c-23a9-41c2-8ce8-925c6760231a


### Testing?

- I didn't locally deploy or anything but here is [the working
collections link](https://dev.openveda.cloud/api/stac/collections)

### Notes
- I think we could technically also update
https://github.com/NASA-IMPACT/veda-backend/blob/develop/stac_api/runtime/src/app.py#L79
to be:
```{"request": request, "endpoint": str(request.url).replace("/index.html", "/api/stac")},``` if that's preferred
  • Loading branch information
botanical authored Feb 23, 2024
2 parents 252253f + cfd2956 commit c672098
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

### Issue

Link to relevant GitHub issue

### What?

- Description of the changes made

### Why?

- Description of why the changes were made

### Testing?

- Relevant testing details

3 changes: 2 additions & 1 deletion stac_api/runtime/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@
@app.get("/index.html", response_class=HTMLResponse)
async def viewer_page(request: Request):
"""Search viewer."""
path = api_settings.root_path or ""
return templates.TemplateResponse(
"stac-viewer.html",
{"request": request, "endpoint": str(request.url).replace("/index.html", "")},
{"request": request, "endpoint": str(request.url).replace("/index.html", path)},
media_type="text/html",
)

Expand Down

0 comments on commit c672098

Please sign in to comment.