A set of functions for testing out Google Cloud Functions.
npm run build
will zip up the directory. Once you've run that command you can upload the zip to a GCS bucket however you'd like (Using the upload zip
option in GCF is a quick way to do it).
When creating a GCF, import the zip folder from your storage bucket (or upload). Then, in the Function to execute
input field, place one of the methods exported in the main index.js
file.
Store credentials in .creds.js
in an object. It will get zipped up with the rest of the project and ignored in source control.
module.exports = {
twilioPhoneNumber: "<Phone>",
twilioAccountSid: "<SID>",
twilioAuthToken: "<AuthToken>"
}
You can use the functions-emulator to run any of the functions locally prior to deploying your function. Basic functionality of the emulator is included in the npm scripts so you don't have to install it globally.
npm start
, to start up the emulatornpm run deploy -- <functionName> --<flags>
, to deploy your function locallynpm run call -- <functionName>
, to call your methodnpm run logs
, to get logs from your functionnpm run stop
, stops GCF emulator
npm run inspect --<functionName>
, to run your function in debug modenpm run logs
to get chrome debug url