Last active
September 7, 2020 04:07
-
-
Save fredriccliver/af9b04fb65dd1538a1b1dd1cd8dde112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let functions = firebase.functions() | |
functions.useFunctionsEmulator('http://localhost:5001') | |
let btn = document.querySelector("#btn-get-data") | |
let label = document.querySelector("#label") | |
let retrieveData = functions.httpsCallable("retrieve") | |
btn.addEventListener("click", (e) => { | |
retrieveData() | |
.then((res) => { | |
label.innerHTML = res.data | |
console.log("successfully retrieved") | |
}) | |
.catch((e) => console.log(e)) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment