Fix historico so it uses an object as parameter

This commit is contained in:
Roberto Alsina 2023-02-08 14:21:38 -03:00
parent 161cb598c4
commit 10e804babc
2 changed files with 4 additions and 3 deletions

View File

@ -7,9 +7,9 @@ docker run --rm --privileged \
--reset -p yes
# Build and deploy
if [ ! -d templates]
if [ ! -d template ]
then
faas-cli template store pull python3-http
faas-cli template store pull python3-flask
fi
faas-cli publish -f nombres.yml --platforms linux/arm64 --build-arg 'TEST_ENABLED=false'
faas-cli deploy -f nombres.yml

View File

@ -26,12 +26,13 @@ def handle(req):
Args:
req (str): request body
[nombre1, nombre2, ... nombreN]
{"i": ["nombre1, nombre2"]}
"""
nombres = []
try:
nombres = loads(req)
nombres = nombres["i"].split(",")
nombres = [remove_accents(x.strip().lower()) for x in nombres]
nombres = [n for n in nombres if n]
except Exception: