-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
https://us-central1-lml-stranding-map.cloudfunctions.net/api
The backend API is an Express server that is deployed with Firebase Functions. Although it appears on the Firebase console, its endpoints are not listed as Functions.
Writes stranding records provided in request body to firebase database.
URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/firebaseupload
Method: POST
Parameters:
-
userToken
String: Authentication token generated by Firebase Auth to ensure only logged in users are able to use this endpoint. -
record
Geojson object: Stranding report that will be updated/written to the database.
Clients (who uses this endpoint):
-
/src/Components/UploadPopup.js
-
uploadFeatureCollection()
makes the call toapi.uploadData()
-
-
/src/api.js
-
uploadData()
makes POST request to https://us-central1-lml-stranding-map.cloudfunctions.net/api/firebaseupload with data as the request body
-
Takes filter parameters in the request body and performs a search on the algolia index with those parameters, returns search results.
URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/algoliasearch
Method: POST
Parameters: A javascript object containing the following attributes:
-
facetFilters
Array of strings: Which facets to search by. -
hitsPerPage
Integer: How many results to return. Set to 1000. -
attributesToRetrieve
Array of strings: Which attributes to include in results. Set to [“*”] (include all).
Clients (who uses this endpoint):
-
/src/Components/Filter.js
-
getResults()
constructs the data object and callsapi.searchAlgolia(data)
-
-
/src/api.js
-
searchAlgolia(data)
makes a POST request to https://us-central1-lml-stranding-map.cloudfunctions.net/api/algoliasearch with data as the request body.
-
Returns ‘Hello from Firebase!’. Used for testing.
URL: https://us-central1-lml-stranding-map.cloudfunctions.net/api/hello
Method: GET