Skip to main content

A short description

Project description

Web测试项目

这是一个简单的Flask web测试项目,包含多种API测试功能。

功能特性

  • 🏠 主页界面: 美观的web界面,包含各种测试功能
  • 📡 API测试: GET和POST请求测试
  • 🌐 外部API测试: 测试调用外部API服务
  • ❤️ 健康检查: 服务状态监控
  • 🐳 Docker支持: 容器化部署
  • 🔧 错误处理: 完善的错误处理机制

项目结构

testrepoflow/
├── app.py              # Flask应用主文件
├── requirements.txt    # Python依赖
├── Dockerfile         # Docker配置
├── templates/         # HTML模板
│   └── index.html     # 主页模板
└── README.md          # 项目说明

本地运行

1. 安装依赖

pip install -r requirements.txt

2. 运行应用

python app.py

应用将在 http://localhost:5000 启动

3. 访问功能

Docker运行

1. 构建镜像

docker build -t testrepoflow .

2. 运行容器

docker run -p 5000:5000 testrepoflow

API端点

GET /api/test

返回简单的JSON响应

POST /api/test

接收JSON数据并返回确认响应

GET /api/external-test

测试外部API调用(jsonplaceholder.typicode.com)

GET /health

健康检查端点,返回服务状态

测试功能

访问主页后,你可以:

  1. 测试GET API: 发送GET请求到本地API
  2. 测试POST API: 发送POST请求到本地API
  3. 测试外部API: 调用外部测试API
  4. 健康检查: 检查服务运行状态
  5. 自定义POST测试: 发送自定义数据

所有测试结果会实时显示在页面上,包含完整的JSON响应数据。

开发说明

  • Flask应用运行在调试模式
  • 支持热重载
  • 包含错误处理和日志记录
  • 响应格式统一为JSON

扩展建议

你可以在此基础上添加:

  • 数据库集成
  • 用户认证
  • 更多API端点
  • 单元测试
  • 日志系统
  • 配置管理

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testrepoflow-1.0.0.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testrepoflow-1.0.0-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file testrepoflow-1.0.0.tar.gz.

File metadata

  • Download URL: testrepoflow-1.0.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for testrepoflow-1.0.0.tar.gz
Algorithm Hash digest
SHA256 377b0ad99fe17f97346c0a1f36960589c5dd19b57149d9a5724081bd7622631e
MD5 af86af0fb72b00487ec9ab96cf14d0ea
BLAKE2b-256 423955bfc158d10b6a94dd7b5b5ee2f11520c9dcb136f4eb6958c5da93df65bc

See more details on using hashes here.

File details

Details for the file testrepoflow-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: testrepoflow-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for testrepoflow-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38af10cda9842ea6008909ad46415f785299f824d63d2b7a36d56ec334d0ffb8
MD5 7e39a2efec4208b3817defe7a2676285
BLAKE2b-256 e023de1477e3ee549e231e346737143a0224cbf2841604f58427e91a692a1a40

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page