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,26 @@
{{define "usage-examples"}}
<h2>🔄 Usage</h2>
<div class="step">
<strong>Step 1:</strong> Upload a file using POST /upload with form-data 'file' parameter
</div>
<div class="step">
<strong>Step 2:</strong> Use the returned 'id' and 'filename' to construct download URL
</div>
<div class="step">
<strong>Step 3:</strong> Download the file using GET /uploads/{id}/{filename}
</div>
<h2>💡 Examples</h2>
<pre><code># 1. Upload a file
curl -X POST -F "file=@myfile.txt" {{.BaseURL}}/upload
# Response will include:
# {
# "id": "abc123...",
# "filename": "myfile.txt",
# "url": "{{.BaseURL}}/uploads/abc123.../myfile.txt"
# }
# 2. Download the file
curl -O {{.BaseURL}}/uploads/abc123.../myfile.txt</code></pre>
{{end}}