Read my blog on OpenFaas Functions
1. pydict
Returns meaning of words provided.
Installation Instructions
Build, Push, and Deploy the function
faas-cli build -f functions.yml --filter pydict
faas-cli push -f functions.yml --filter pydict
faas-cli deploy -f functions.yml --filter pydictInvoke the function:
echo "brevity" | faas-cli invoke pydict2. ytdl
Download mp3 from provided URL
Installation Instructions
Build, Push, and Deploy the function
faas-cli build -f functions.yml --filter ytdl -b ADDITIONAL_PACKAGE=ffmpeg
faas-cli push -f functions.yml --filter ytdl
faas-cli deploy -f functions.yml --filter ytdlInvoke the function:
echo "<url>" | faas-cli invoke ytdl > <filename.mp3>3. translator
Translate between languages.
Installation Instructions
Build, Push, and Deploy the function
faas-cli build -f functions.yml --filter translator
faas-cli push -f functions.yml --filter translator
faas-cli deploy -f functions.yml --filter translatorInvoke the function: Make sure the terminal supports encoding. If not use API testing tool like Insomnia or Postman.
des: output language; defaults to 'en'.
Complete list of supported languages.
echo '{"text": "नमस्ते", "des": "ko"}' | fc invoke translator --content-type "application/json"