Skip to content

Commit

Permalink
chore: added predictor api and osm status to envs
Browse files Browse the repository at this point in the history
  • Loading branch information
jeafreezy committed Jan 3, 2025
1 parent 28ae3bc commit f750c36
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
14 changes: 13 additions & 1 deletion frontend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,16 @@ VITE_MAX_GEOJSON_FILE_UPLOAD_FOR_TRAINING_AREAS = 10
# The maximum GeoJSON file(s) containing the training areas/AOI polygon geometry that a user can upload.
# Data type: Positive Integer (e.g., 1).
# Default value: 10 (10 GeoJSON files, assumming each file has a single AOI).
VITE_MAX_ACCEPTABLE_POLYGON_IN_TRAINING_AREA_GEOJSON_FILE = 10
VITE_MAX_ACCEPTABLE_POLYGON_IN_TRAINING_AREA_GEOJSON_FILE = 10


# The predictor API URL.
# Data type: String (e.g., https://predictor-dev.fair.hotosm.org/predict/).
# Default value: https://predictor-dev.fair.hotosm.org/predict/.
VITE_FAIR_PREDICTOR_API_URL = https://predictor-dev.fair.hotosm.org/predict/.


# The OSM Database status API.
# Data type: String (e.g., https://api-prod.raw-data.hotosm.org/v1/status/).
# Default value: https://api-prod.raw-data.hotosm.org/v1/status/.
VITE_OSM_DATABASE_STATUS_API_URL: https://api-prod.raw-data.hotosm.org/v1/status/
13 changes: 13 additions & 0 deletions frontend/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,17 @@ export const ENVS = {
*/
MAX_ACCEPTABLE_POLYGON_IN_TRAINING_AREA_GEOJSON_FILE: import.meta.env
.VITE_MAX_ACCEPTABLE_POLYGON_IN_TRAINING_AREA_GEOJSON_FILE,

/**
The predictor API URL.
Data type: String (e.g., https://predictor-dev.fair.hotosm.org/predict/).
Default value: https://predictor-dev.fair.hotosm.org/predict/.
*/
FAIR_PREDICTOR_API_URL: import.meta.env.VITE_FAIR_PREDICTOR_API_URL,
/**
The OSM Database status API.
Data type: String (e.g., https://api-prod.raw-data.hotosm.org/v1/status/).
Default value: https://api-prod.raw-data.hotosm.org/v1/status/.
*/
OSM_DATABASE_STATUS_API_URL: import.meta.env.VITE_OSM_DATABASE_STATUS_API_URL,
};
7 changes: 4 additions & 3 deletions frontend/src/services/api-routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { ENVS } from '@/config/env';

/**
* The backend API endpoints.
*/
Expand All @@ -10,12 +12,11 @@ export const API_ENDPOINTS = {

// OSM Database

GET_OSM_DATABASE_LAST_UPDATED:
"https://api-prod.raw-data.hotosm.org/v1/status/",
GET_OSM_DATABASE_LAST_UPDATED: ENVS.OSM_DATABASE_STATUS_API_URL || "https://api-prod.raw-data.hotosm.org/v1/status/",

// Predict

GET_MODEL_PREDICTIONS: "https://predictor-dev.fair.hotosm.org/predict/",
GET_MODEL_PREDICTIONS: ENVS.FAIR_PREDICTOR_API_URL || "https://predictor-dev.fair.hotosm.org/predict/",

// Feedbacks

Expand Down

0 comments on commit f750c36

Please sign in to comment.