Wednesday, December 26, 2018

Firebase : Cloud functions with https trigger

Just running the quick start example seemed to be pretty easy. had to do the below in sequence

1. firebase login
2. firebase use --add from the app directory
3. npm install -g firebase-tools (i had this already installed, so skipped it)
4. cd functions && npm install; cd ..
5. firebase deploy

Done below was the output and hitting the url from browser shown the date.

mylap-MacBook-Pro:time-server mylap$ firebase deploy
⚠  functions: package.json indicates an outdated version of firebase-functions.
 Please upgrade using npm install --save firebase-functions@latest in your functions directory.

=== Deploying to 'mylap-8cb35'...

i  deploying functions
i  functions: ensuring necessary APIs are enabled...
✔  functions: all necessary APIs are enabled
i  functions: preparing functions directory for uploading...
i  functions: packaged functions (52.42 KB) for uploading
✔  functions: functions folder uploaded successfully
i  functions: creating Node.js 6 function date(us-central1)...
✔  functions[date(us-central1)]: Successful create operation.
Function URL (date): https://us-central1-mylap-8cb35.cloudfunctions.net/date

✔  Deploy complete!

Project Console: https://console.firebase.google.com/project/mylap-8cb35/overview
mylap-MacBook-Pro:time-server mylap$


references:
https://github.com/firebase/functions-samples/tree/master/quickstarts/time-server


No comments:

Post a Comment