Skip to content

Latest commit

 

History

History

generate_giphy_gif

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

🖼️ Get Giphy GIF

A Dart Cloud Function for generating Giphy GIF from the Giphy API.

Example input:

{
    "search": "good morning"
}

Example output:

{
    "search": "good morning",
    "gif": "https://giphy.com/gifs/text-gif-sticker-brittdoesdesign-MS9Yq6Y718CSiDTxR5"
}

📝 Environment Variables

List of environment variables used by this cloud function:

GIPHY_API_KEY - Your Giphy API key.

🚀 Deployment

  1. Clone this repository, and enter this function folder:
$ git clone https://github.com/open-runtimes/examples.git && cd examples
$ cd dart/generate_giphy_gif
  1. Enter this function folder and build the code:
docker run -e INTERNAL_RUNTIME_ENTRYPOINT=lib/main.dart --rm --interactive --tty --volume $PWD:/usr/code openruntimes/dart:v2-2.16 sh /usr/local/src/build.sh

As a result, a code.tar.gz file will be generated.

  1. Start the Open Runtime:
docker run -p 3000:3000 -e INTERNAL_RUNTIME_KEY=secret-key --rm --interactive --tty --volume $PWD/code.tar.gz:/tmp/code.tar.gz:ro openruntimes/dart:v2-2.16 sh /usr/local/src/start.sh

Your function is now listening on port 3000, and you can execute it by sending POST request with appropriate authorization headers. To learn more about runtime, you can visit Dart runtime README.

📝 Notes

  • This function is designed for use with Appwrite Cloud Functions. You can learn more about it in Appwrite docs.
  • This example is compatible with Dart 2.16. Other versions may work but are not guaranteed to work as they haven't been tested. Versions below Dart 2.14 will not work, because Apwrite SDK requires Dart 2.14,