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 pydict
Invoke the function:
echo "brevity" | faas-cli invoke pydict
2. 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 ytdl
Invoke 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 translator
Invoke 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"