Skip to content

Instantly share code, notes, and snippets.

@ivamluz
Last active July 28, 2020 00:27
Show Gist options
  • Save ivamluz/2838016bceb0a30b3c992bbe2b057ce6 to your computer and use it in GitHub Desktop.
Save ivamluz/2838016bceb0a30b3c992bbe2b057ce6 to your computer and use it in GitHub Desktop.
Script for testing the HTTP-triggered deployed function
#! /bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SOURCE_DIR="${DIR}/../src"
source "${DIR}/.env.local"
TRIGGER_URL=$(
gcloud functions \
describe ${FUNCTION_NAME_HTTP} \
--format="value(httpsTrigger.url)"
)
ENDPOINT="${TRIGGER_URL}?subject=FooBar"
echo "Sending GET request to ${ENDPOINT}"
echo
curl -i $ENDPOINT
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment