agalera / PS_LG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PS_LG

Ejercicio 1

La funcionalidad requerida está en utils.py.

He creado una pequeña api para exponer estas funcionalidades.

Podemos arrancar la api de dos maneras:

Docker

./build.sh
./start.sh

Native

pip3 install -r requirements.txt
python3 run.py

La api se ejecutará en http://localhost:4423

Ejemplos de llamadas con Curl:

curl http://localhost:4423/is_perfect/12
curl http://localhost:4423/is_abundant/12
curl http://localhost:4423/is_deficient/12
curl --header "Content-Type: application/json" --request POST --data '[10, 1000]' http://localhost:4423/type_value_list

Ejemplos de llamadas con requests:

requests.get('http://localhost:4423/is_perfect/123').json()
requests.get('http://localhost:4423/is_abundant/123').json()
requests.get('http://localhost:4423/is_deficient/123').json()
requests.post('http://localhost:4423/type_value_list', json=[10, 1000]).json()

Ejercicio 2

Para instalar las dependencias y arrancar el server http:

npm install
npm start

La web se ejecutará en http://localhost:8080

About


Languages

Language:JavaScript 53.5%Language:Python 36.6%Language:HTML 8.2%Language:Shell 1.1%Language:CSS 0.7%