Skip to content

Commit 4ece2a5

Browse files
authored
Merge pull request #609 from FalkorDB/secure-mutating-endpoints
Migrate backend from Flask to FastAPI
2 parents 73ddd82 + 11b92ab commit 4ece2a5

14 files changed

Lines changed: 632 additions & 996 deletions

.github/workflows/playwright.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ jobs:
8181
npx playwright install chromium firefox
8282
npx playwright install-deps chromium firefox
8383
84-
- name: Start Flask server
84+
- name: Start server
8585
id: start-server
8686
env:
8787
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
8888
SECRET_TOKEN: ${{ secrets.SECRET_TOKEN }}
8989
CODE_GRAPH_PUBLIC: "1"
9090
MODEL_NAME: "openai/gpt-4.1-mini"
9191
run: |
92-
uv run flask --app api/index.py run --host 0.0.0.0 --port 5000 &
92+
uv run uvicorn api.index:app --host 0.0.0.0 --port 5000 &
9393
echo "pid=$!" >> "$GITHUB_OUTPUT"
94-
# Wait for Flask to be ready
94+
# Wait for server to be ready
9595
timeout 30 bash -c 'until curl -s http://localhost:5000/ > /dev/null 2>&1; do sleep 0.5; done'
9696
9797
- name: Run Playwright tests
@@ -102,7 +102,7 @@ jobs:
102102
MODEL_NAME: "openai/gpt-4.1-mini"
103103
run: npx playwright test --shard=${{ matrix.shard }}/2 --reporter=dot,list
104104

105-
- name: Stop Flask server
105+
- name: Stop server
106106
if: always()
107107
run: kill ${{ steps.start-server.outputs.pid }} 2>/dev/null || true
108108

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ clean: ## Clean up build and test artifacts
4040
find . -name "*.pyo" -delete
4141

4242
run-dev: build-dev ## Run development server (Python backend serving built frontend)
43-
uv run flask --app api/index.py run --host $${HOST:-127.0.0.1} --port $${PORT:-5000} --debug
43+
uv run uvicorn api.index:app --host $${HOST:-127.0.0.1} --port $${PORT:-5000} --reload
4444

4545
run-prod: build-prod ## Run production server
46-
uv run flask --app api/index.py run --host $${HOST:-0.0.0.0} --port $${PORT:-5000}
46+
uv run uvicorn api.index:app --host $${HOST:-0.0.0.0} --port $${PORT:-5000}
4747

4848
docker-falkordb: ## Start FalkorDB in Docker for testing
4949
docker run -d --name falkordb-test -p 6379:6379 falkordb/falkordb:latest

0 commit comments

Comments
 (0)