alejandroAPI
Live Demo:
Introduction
Simple API to return my details
Prerequisite
Running app locally
docker build -f Dockerfile -t morsisdivine:alejandroapi .
docker run --rm -it -p 8080:8080 -d morsisdivine:alejandroapi
Run app from dockerimage
docker run --rm -it -p 8080:8080 -d morsisdivine/alejandroapi
Running tests
Local
newman run Guarded\ Scrubland\ Password\ API.postman_collection.json --env-var url='http://localhost:8080'
Production
newman run Guarded\ Scrubland\ Password\ API.postman_collection.json --env-var url='https://guarded-scrubland-78590.herokuapp.com'
Performance test
cd k6
k6 run --vus 10 --duration 30s perf.spec.js
Endpoints
- / => give the name of the API
- /words => provides a password
- /palabras => provides a password in Spanish
- /worts => provides a password in German
- /giphy/:term => search the top 10 giphy of that kind
- /api/password?number=5&language=palabras&special=true => provides a password in spanish with special characters
- /api/hash?password=mypassword => provides a SHA512 password created with mkpasswd
Heroku load
- heroku login
- heroku container:login || docker login --username=_ --password=$(heroku auth:token) registry.heroku.com
- heroku create
- heroku container:push web --app <heroku_app_name>
* heroku container:push web --app guarded-scrubland-78590
or
- docker tag <image> registry.heroku.com/<app>/<process-type>
- docker push registry.heroku.com/<app>/<process-type>