Skip to content

Örnekler

Warning

Örneklerdeki tüm değerler temsilîdir. Gerçek kullanıcı adı, parola, token veya adres içermez.

Giriş ve token alma

curl -X POST http://localhost:3001/api/v1/login \
  -H "Content-Type: application/json" \
  -d '{"username":"<kullanici>","password":"<parola>"}'

Kayıtları listeleme

curl http://localhost:3001/api/v1/api-docs-list \
  -H "Authorization: Bearer <TOKEN>"

Kayıt oluşturma

curl -X POST http://localhost:3001/api/v1/create-api-doc \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
        "api_name": "Ornek API",
        "url": "/api/v1/ornek",
        "engine_type": "input",
        "total_count": 12,
        "system_count": 2,
        "input_count": 7,
        "output_count": 3
      }'

201 yanıtı

{
  "success": true,
  "message": "...",
  "data": { }
}

Kayıt güncelleme ve silme

curl -X PUT http://localhost:3001/api/v1/update-api-doc/<ID> \
  -H "Authorization: Bearer <TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"api_name":"Yeni Ad"}'

curl -X DELETE http://localhost:3001/api/v1/delete-api-doc/<ID> \
  -H "Authorization: Bearer <TOKEN>"

Sağlık kontrolü

curl -i http://localhost:3001/health

Docker Compose aynı kontrolü Node ile yapar (imajda curl/wget yoktur):

node -e "fetch('http://127.0.0.1:3001/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"

OpenAPI dokümanı

curl http://localhost:3001/openapi.json
curl http://localhost:3001/openapi.yaml