Templating

This commit is contained in:
2025-08-08 00:04:07 +02:00
parent e26e85b069
commit 20e3466f2f
9 changed files with 407 additions and 393 deletions

View File

@@ -0,0 +1,35 @@
{{define "api-endpoints"}}
<h2>📋 API endpoints</h2>
<div class="endpoint">
<button class="copy-btn" 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" 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" 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" 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}}