This repository contains the minimum necessary code to create a web server, update it using a python script, and retrieve information with a GET request.
- Clone repo
git clone [email protected]:agrofides/bare-bones-api.git
and cd into the project - Run
docker-compose build
to build the docker containers - Run
docker-compose up
to launch the containers
-
In a new terminal run
docker-compose exec api flask db init
to create a new database migration repository -
Run
docker-compose exec api flask db migrate
to create a new revision -
Run
docker-compose exec api flask db upgrade
to persist the newly created revision
- Run
docker-compose exec api python -m app.bin.setup_roles
. - Also change the
enabled
fields on line 24 and do 1 again to show update functionality
-
Go to http://localhost:5000/roles to see the created roles
Ctrl+c in flask window
1. Build docker containers 2. `docker-compose exec api python -m app.bin.nukedb` 3. Initialize DB and import schema
Defined schema for database entry, in this case user accounts
Script to populate database with user roles entries
contains welcome page, error page, and get user roles pages (all and by role id)
Jacob Smith for AgroFides, Winter 2021