support json files for forms and default to running the server locally to using not wsgi w/ burnettk

This commit is contained in:
jasquat 2022-06-27 16:59:59 -04:00
parent e374813609
commit 7c36197834
3 changed files with 9 additions and 1 deletions

View File

@ -19,4 +19,8 @@ fi
export FLASK_SESSION_SECRET_KEY=super_secret_key
export APPLICATION_ROOT="/"
./bin/boot_server_in_docker
if [[ -n "${SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA:-}" ]]; then
./bin/boot_server_in_docker
else
FLASK_APP=src/spiffworkflow_backend poetry run flask run -p 7000
fi

View File

@ -50,6 +50,7 @@ class FileType(SpiffEnum):
docx = "docx"
gif = "gif"
jpg = "jpg"
json = "json"
md = "md"
pdf = "pdf"
png = "png"
@ -73,6 +74,7 @@ CONTENT_TYPES = {
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"gif": "image/gif",
"jpg": "image/jpeg",
"json": "application/json",
"md": "text/plain",
"pdf": "application/pdf",
"png": "image/png",

View File

@ -6,6 +6,8 @@ from spiffworkflow_backend.services.acceptance_test_fixtures import load_fixture
app = create_app()
# this is in here because when we put it in the create_app function,
# it also loaded when we were running migrations, which resulted in a chicken/egg thing.
if os.environ.get("SPIFFWORKFLOW_BACKEND_LOAD_FIXTURE_DATA") == "true":
with app.app_context():
load_fixtures()