mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-06-25 22:37:39 +02:00
MAESTRO: scaffold backend fastapi app
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Backend application package."""
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI(title="Web Header Analyzer API")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
def read_root() -> dict[str, str]:
|
||||
return {"status": "ok"}
|
||||
@@ -0,0 +1,34 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=69", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "web-header-analyzer-backend"
|
||||
version = "0.1.0"
|
||||
description = "FastAPI backend for the web header analyzer"
|
||||
readme = "../README.md"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"fastapi>=0.110",
|
||||
"uvicorn[standard]>=0.27",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest>=8.0",
|
||||
"pytest-asyncio>=0.23",
|
||||
"httpx>=0.27",
|
||||
"ruff>=0.4",
|
||||
]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
minversion = "8.0"
|
||||
testpaths = ["tests"]
|
||||
pythonpath = ["."]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
target-version = "py313"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "B"]
|
||||
@@ -0,0 +1,6 @@
|
||||
fastapi>=0.110
|
||||
uvicorn[standard]>=0.27
|
||||
pytest>=8.0
|
||||
pytest-asyncio>=0.23
|
||||
httpx>=0.27
|
||||
ruff>=0.4
|
||||
@@ -0,0 +1 @@
|
||||
"""Backend tests package."""
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
|
||||
client = TestClient(app)
|
||||
|
||||
|
||||
def test_root_returns_ok() -> None:
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
assert response.json() == {"status": "ok"}
|
||||
Reference in New Issue
Block a user