Files
cv-site/API-QUICK-REFERENCE.md
T
juanatsap 5e132e7ec7 docs: finalize documentation as personal portfolio project
- Add clear disclaimers: personal site, not a template
- Update CONTRIBUTING.md: not seeking contributions
- Remove all Docker files and references (11 files)
- Rewrite DEPLOYMENT.md without Docker (VPS/cloud focus)
- Add comprehensive API documentation with verified endpoints
- Add complete CUSTOMIZATION guide
- Add project status sections to all major docs
- Clarify MIT license but personal use intent

Created documentation files:
- API.md (70KB) - Complete API reference with live testing
- API-QUICK-REFERENCE.md - Quick command reference
- DEPLOYMENT.md (45KB) - VPS, cloud, manual deployment (no Docker)
- CUSTOMIZATION.md (38KB) - Complete customization guide
- PROJECT-DOCUMENTATION-SUMMARY.md - Complete project overview

This is my personal CV site. While code is public (MIT),
it's designed for my personal use, not as a template.
2025-11-09 13:54:31 +00:00

112 lines
1.8 KiB
Markdown

# API Quick Reference
## Base URL
```
http://localhost:1999
```
## Endpoints
### 🏠 Home Page
```bash
GET /?lang={en|es}
```
Full HTML page with CV content.
### 📄 CV Content (HTMX)
```bash
GET /cv?lang={en|es}
```
HTML partial for HTMX swaps.
### 📥 PDF Export
```bash
GET /export/pdf?lang={en|es}
```
Downloads PDF resume (~1.8 MB, takes ~3 seconds).
### ❤️ Health Check
```bash
GET /health
```
Returns JSON: `{"status": "ok", "timestamp": "...", "version": "1.0.0"}`
### 🎨 Static Files
```bash
GET /static/{path}
```
Serves CSS, JS, images with cache headers.
## Quick Tests
### Test All Endpoints
```bash
# Health
curl http://localhost:1999/health | jq
# Home (English)
curl "http://localhost:1999/?lang=en"
# Home (Spanish)
curl "http://localhost:1999/?lang=es"
# CV Content
curl "http://localhost:1999/cv?lang=en"
# PDF Export
curl -O -J "http://localhost:1999/export/pdf?lang=en"
# Static File
curl -I http://localhost:1999/static/css/main.css
```
### HTMX Language Switcher
```html
<button
hx-get="/cv?lang=en"
hx-target="#cv-content"
hx-swap="innerHTML"
hx-push-url="/?lang=en">
English
</button>
```
## Error Codes
| Code | Meaning | Example |
|------|---------|---------|
| 200 | Success | All valid requests |
| 400 | Bad Request | `?lang=invalid` |
| 404 | Not Found | `/nonexistent` |
| 500 | Server Error | Template/data/PDF error |
## Performance
- **Health**: <1ms
- **HTML Pages**: 7-8ms
- **Static Files**: <5ms
- **PDF Export**: ~3 seconds
## Configuration (ENV)
```bash
PORT=1999
HOST=localhost
GO_ENV=development
READ_TIMEOUT=15
WRITE_TIMEOUT=15
```
## Security Headers
✅ Content-Security-Policy
✅ X-Frame-Options: SAMEORIGIN
✅ X-Content-Type-Options: nosniff
✅ Referrer-Policy
✅ Permissions-Policy
✅ HSTS (production only)
## Need More Details?
See [API.md](API.md) for complete documentation.