Updating README.md File
هذا الالتزام موجود في:
47
README.md
47
README.md
@@ -16,7 +16,7 @@ fruit-api/
|
|||||||
│── fruit_api.log # API logs
|
│── fruit_api.log # API logs
|
||||||
│── README.md # Documentation
|
│── README.md # Documentation
|
||||||
│── .gitignore # Ignore venv/logs
|
│── .gitignore # Ignore venv/logs
|
||||||
│── .github/workflows/ci.yml # CI workflow for testing
|
│── .github/workflows/cicd.yml # CI workflow for testing
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -29,9 +29,7 @@ fruit-api/
|
|||||||
- Bash script for monitoring logs (`log_monitor.sh`) with **error alerts (4xx/5xx)**
|
- Bash script for monitoring logs (`log_monitor.sh`) with **error alerts (4xx/5xx)**
|
||||||
- Bash script for automated API testing (`test_api.sh`) with ✅ / ❌ results
|
- Bash script for automated API testing (`test_api.sh`) with ✅ / ❌ results
|
||||||
- Swagger/OpenAPI documentation at `/docs`
|
- Swagger/OpenAPI documentation at `/docs`
|
||||||
- `CI/CD` pipeline for automated testing
|
- `CI/CD`via GitPasha Actions → Ghaymah Cloud Deployment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ⚙️ Setup Instructions
|
## ⚙️ Setup Instructions
|
||||||
@@ -87,7 +85,7 @@ http://localhost:5000
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
## 📑 Example Usage (with curl)
|
## 📑 Example Usage (with curl) Locally
|
||||||
|
|
||||||
- **Get all fruits**
|
- **Get all fruits**
|
||||||
```bash
|
```bash
|
||||||
@@ -104,7 +102,7 @@ curl -X POST http://localhost:5000/fruits -H "Content-Type: application/json"
|
|||||||
curl -X PUT http://localhost:5000/fruits/1 -H "Content-Type: application/json" -d '{"name":"Green Apple","price":1.8}'
|
curl -X PUT http://localhost:5000/fruits/1 -H "Content-Type: application/json" -d '{"name":"Green Apple","price":1.8}'
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📝 Logging
|
## 📝 Logging
|
||||||
|
|
||||||
@@ -168,12 +166,39 @@ After starting the API, open:
|
|||||||
|
|
||||||
## ⚡ CI/CD Pipeline
|
## ⚡ CI/CD Pipeline
|
||||||
### Workflow
|
### Workflow
|
||||||
- Triggered on every **push** or **pull request** to `main` branch.
|
- Triggered on every **git push** or **pull request** to `main` branch.
|
||||||
- Installs dependencies (`requirements.txt`).
|
- GitPasha Actions automatically :
|
||||||
- Starts the API in the background.
|
1. Installs dependencies (`requirements.txt`).
|
||||||
- Runs automated tests (`test_api.sh`).
|
2. Starts the API in the background.
|
||||||
- Pipeline **fails** if any test ❌ fails.
|
3. Runs automated tests (`test_api.sh`).
|
||||||
|
4. Pipeline **fails** if any test ❌ fails.
|
||||||
|
5. Builds the Docker image
|
||||||
|
6. Deploys to Ghaymah Cloud
|
||||||
|
|
||||||
|
✅ Deployment URL :
|
||||||
|
```bash
|
||||||
|
https://building-api-and-monitoring-logs-1e053dacf5df.hosted.ghaymah.systems
|
||||||
|
```
|
||||||
|
✅ API Documentation URL :
|
||||||
|
```bash
|
||||||
|
https://building-api-and-monitoring-logs-1e053dacf5df.hosted.ghaymah.systems/docs
|
||||||
|
```
|
||||||
|
## 📑 Example Usage (with curl) on Ghaymah Cloud
|
||||||
|
|
||||||
|
- **Get all fruits**
|
||||||
|
```bash
|
||||||
|
curl https://building-api-and-monitoring-logs-1e053dacf5df.hosted.ghaymah.systems/fruits
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Add a fruit**
|
||||||
|
```bash
|
||||||
|
curl -X POST curl https://building-api-and-monitoring-logs-1e053dacf5df.hosted.ghaymah.systems/fruits -H "Content-Type: application/json" -d '{"name":"Mango","color":"Yellow","price":2.5,"quantity":50,"category":"Tropical"}'
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Update a fruit**
|
||||||
|
```bash
|
||||||
|
curl -X PUT curl https://building-api-and-monitoring-logs-1e053dacf5df.hosted.ghaymah.systems/fruits/1 -H "Content-Type: application/json" -d '{"name":"Green Apple","price":1.8}'
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 🐳 Docker Support
|
## 🐳 Docker Support
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم