Files
fitra-backend/views/partials/api-endpoints.html
2025-08-08 00:53:04 +02:00

35 lines
1.7 KiB
HTML

{{define "api-endpoints"}}
<h2>📋 API endpoints</h2>
<div class="endpoint">
<button class="copy-btn" data-rybbit-event="Copy 1" onclick="copyToClipboard('curl -X POST -F &quot;file=@/path/to/your/file.txt&quot; {{.BaseURL}}/upload')">📋 Copy</button>
<h3><span class="method post">POST</span>/upload</h3>
<p><strong>Description:</strong> Upload a file</p>
<p><strong>cURL example:</strong></p>
<pre><code>curl -X POST -F "file=@/path/to/your/file.txt" {{.BaseURL}}/upload</code></pre>
</div>
<div class="endpoint">
<button class="copy-btn" data-rybbit-event="Copy 2" onclick="copyToClipboard('curl -O {{.BaseURL}}/uploads/{fileID}/{filename}')">📋 Copy</button>
<h3><span class="method get">GET</span>/uploads/{fileID}/{filename}</h3>
<p><strong>Description:</strong> Download a file using the ID and filename from upload response</p>
<p><strong>cURL example:</strong></p>
<pre><code>curl -O {{.BaseURL}}/uploads/{fileID}/{filename}</code></pre>
</div>
<div class="endpoint">
<button class="copy-btn" data-rybbit-event="Copy 3" onclick="copyToClipboard('curl {{.BaseURL}}/storage')">📋 Copy</button>
<h3><span class="method get">GET</span>/storage</h3>
<p><strong>Description:</strong> Check storage usage and capacity</p>
<p><strong>cURL example:</strong></p>
<pre><code>curl {{.BaseURL}}/storage</code></pre>
</div>
<div class="endpoint">
<button class="copy-btn" data-rybbit-event="Copy 4" onclick="copyToClipboard('curl {{.BaseURL}}/health')">📋 Copy</button>
<h3><span class="method get">GET</span>/health</h3>
<p><strong>Description:</strong> Check service health</p>
<p><strong>cURL example:</strong></p>
<pre><code>curl {{.BaseURL}}/health</code></pre>
</div>
{{end}}