From 73e807cee4f0afb8344d232877fe3180aebdb8f3 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sat, 4 Feb 2023 17:21:48 +0100 Subject: [PATCH] Use .flaskenv to setup environment --- .flaskenv | 3 +++ .github/workflows/contracts.yaml | 8 ++------ requirements.txt | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 .flaskenv diff --git a/.flaskenv b/.flaskenv new file mode 100644 index 0000000..bc9047c --- /dev/null +++ b/.flaskenv @@ -0,0 +1,3 @@ +FLASK_APP=server.py +FLASK_DEBUG=1 +FLASK_RUN_PORT=5000 diff --git a/.github/workflows/contracts.yaml b/.github/workflows/contracts.yaml index f1831ea..255719f 100644 --- a/.github/workflows/contracts.yaml +++ b/.github/workflows/contracts.yaml @@ -59,15 +59,11 @@ jobs: - name: Run API server if: matrix.os != 'windows-latest' - run: flask run --port 5000 & - env: - FLASK_APP: server.py + run: flask run & - name: Run API server if: matrix.os == 'windows-latest' - run: Start-Process -NoNewWindow flask -ArgumentList 'run --port 5000' - env: - FLASK_APP: server.py + run: Start-Process -NoNewWindow flask -ArgumentList 'run' - name: Setup specmatic uses: airslate-oss/setup-specmatic@v1 diff --git a/requirements.txt b/requirements.txt index dc2f8cb..bb0b842 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ Flask==2.2.2 itsdangerous==2.1.2 Jinja2==3.1.2 MarkupSafe==2.1.2 +python-dotenv==0.21.1 Werkzeug==2.2.2