هذا الالتزام موجود في:
22
README.md
22
README.md
@@ -2,9 +2,9 @@
|
||||
# 🍎 Fruit Store API
|
||||
|
||||
A simple **RESTful API** built with Flask that manages fruits in a store.
|
||||
The project also includes **logging**, a **log monitoring script**, and **automated testing script** with clear pass/fail output.
|
||||
The project also includes **logging**, a **log monitoring script**, and **automated testing script** with clear pass/fail output . This project uses **GitHub Actions Continuous Integration (CI)** to ensure the API works correctly after every code change .
|
||||
|
||||
|
||||
---
|
||||
## 📂 Project Structure
|
||||
```
|
||||
fruit-api/
|
||||
@@ -33,7 +33,7 @@ fruit-api/
|
||||
- `CI/CD` pipeline for automated testing
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## ⚙️ Setup Instructions
|
||||
|
||||
@@ -64,7 +64,7 @@ python3 fruit_api.py
|
||||
API will start at :
|
||||
👉 `http://localhost:5000`
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🚀 API Endpoints
|
||||
|
||||
@@ -86,7 +86,7 @@ http://localhost:5000
|
||||
| GET | `/fruits/search?name=<name>` | Search fruits by name |
|
||||
| GET | `/health` | Health check |
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 📑 Example Usage (with curl)
|
||||
|
||||
@@ -119,7 +119,7 @@ Example log:
|
||||
2025-09-29 18:05:22 - IP:127.0.0.1 - METHOD:GET - ENDPOINT:/fruits - STATUS:200
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🔎 Monitoring (log_monitor.sh)
|
||||
|
||||
@@ -134,7 +134,7 @@ Run it in background:
|
||||
bash log_monitor.sh &
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🤖 API Testing (test_api.sh)
|
||||
|
||||
@@ -159,18 +159,15 @@ Example output:
|
||||
✅ All tests passed!
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 📘 Swagger Documentation
|
||||
After starting the API, open:
|
||||
👉 [http://localhost:5000/docs](http://localhost:5000/docs)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## ⚡ CI/CD Pipeline
|
||||
|
||||
This project uses **Continuous Integration (CI)** to ensure the API works correctly after every code change.
|
||||
|
||||
### Workflow
|
||||
- Triggered on every **push** or **pull request** to `main` branch.
|
||||
- Installs dependencies (`requirements.txt`).
|
||||
@@ -178,7 +175,6 @@ This project uses **Continuous Integration (CI)** to ensure the API works correc
|
||||
- Runs automated tests (`test_api.sh`).
|
||||
- Pipeline **fails** if any test ❌ fails.
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 🐳 Docker Support
|
||||
|
المرجع في مشكلة جديدة
حظر مستخدم