docker
installed and that the Docker daemon is runningdocker build -t overloop-tech-test-backend .
docker run -it -p 5000:5000 overloop-tech-test-backend
curl http://localhost:5000/articles
pyenv versions
pyenv install 3.7.4
~/.pyenv/versions/3.7.4/bin/python -m venv env
source env/bin/activate
python --version
pip install -r requirements.txt
python setup_and_seed.py
to get a local database setup and seeded with lookup dataflask run
or python app.py
in the root directorynode 'overloop-demo' {
# common baseline for all nodes
include is_puppet_base::node_base
# team SSH access
include passwd_common
# the necessary overloop environment in the desired branch
class { 'overloop_env': branch => 'issue04_check_robustness' }
# firewall rule allowing access from the Internet or a whitelist of IPs
firewall { '300 API HTTPS ': proto => 'tcp', dport => 443, action => 'accept', }
}
cd /home/deployment/overloop
sudo python3 setup_and_seed.py
The initialized database will be at /home/deployment/overloop/database.db.
techtest/models
foldertechtest/routes
folderIn both cases, the modules are loaded by using the __all__
variable in __init__.py
, so be sure to update this if you add new files.
Internally:
curl http://localhost:8080/articles
curl http://localhost:8080/regions
curl http://localhost:8080/authors
curl http://localhost:8080/article/1
curl http://localhost:8080/region/1
curl http://localhost:8080/author/1
curl -X POST http://localhost:8080/add_author --form username=USERNAME --form password=PASSWORD --form 'content={"first_name":"Al","last_name":"Packa"}'
curl -X POST http://localhost:8080/edit_author --form username=USERNAME --form password=PASSWORD --form 'content={ "id:9898989", "first_name":"Al","last_name":"Pacone"}'
curl -X POST http://localhost:8080/add_article --form username=USERNAME --form password=PASSWORD \
--form 'content={ "title":"R0 versus 2020","content":"exponentially spreading literature blala", "authors":["1","2"], "regions":["1", "3"] }'
curl -X POST http://localhost:8080/edit_article --form username=USERNAME --form password=PASSWORD \
--form 'content={ "id":"3453455", "title":"R0 versus 2020","content":"exponentially spreading literature blala", "authors":["1","2"], "regions":["1", "3"] }'
curl -X POST http://localhost:8080/delete_article --form username=USERNAME --form password=PASSWORD --form 'content={ "id":"3453455"}'
From the outside:
curl https://PUBLICURL/articles
curl https://PUBLICURL/regions
[...]
These invocations should return JSON content.