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

Fix/add root path #26

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 5 additions & 1 deletion deforestation_api/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ async def lifespan(deforestation_app: FastAPI):
app.include_router(healthcheck.router)

# The OpenEPI logo needs to be served as a static file since it is referenced in the OpenAPI schema
app.mount("/static", StaticFiles(directory="deforestation_api/assets/"), name="static")
app.mount(
f"/{settings.api_root_path}/static",
StaticFiles(directory="deforestation_api/assets"),
name="static",
)

logging.basicConfig(level=logging.INFO)

Expand Down
4 changes: 2 additions & 2 deletions deployment/kubernetes/deforestation-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ spec:
prometheus.io/path: "/metrics"
spec:
containers:
- image: ghcr.io/openearthplatforminitiative/deforestation-api:0.3.3
- image: ghcr.io/openearthplatforminitiative/deforestation-api:0.3.4
name: deforestation-api
ports:
- containerPort: 8080
env:
- name: API_ROOT_PATH
value: "/deforestation"
- name: VERSION
value: 0.3.3
value: 0.3.4
- name: API_DOMAIN
valueFrom:
configMapKeyRef:
Expand Down
Loading