API Endpoints
Content Routes
Section titled “Content Routes”| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Root directory listing |
/*path |
GET | Markdown file or directory listing |
Directory pages show a card grid with file/folder icons, titles, and last modified dates. Directories are sorted first, then files, alphabetically.
Path Resolution
Section titled “Path Resolution”.mdextension is optional:/aboutand/about.mdboth work- Trailing slashes are normalized
- Case-insensitive matching as a fallback
- Non-markdown files (images, PDFs, JSON) are served as raw assets
Health Check
Section titled “Health Check”GET /healthReturns JSON with server status, version, uptime, and dependency health:
{ "status": "healthy", "version": "1.0.0", "commit": "abc123", "uptime": "2h30m", "dependencies": { "repository": { "status": "healthy", "modified": "2026-07-13T..." }, "cache": { "status": "healthy", "size": 42, "hits": 100, "misses": 5, "hitRate": 0.95 } }}Refresh
Section titled “Refresh”GET /refreshPOST /refreshReloads all content from the storage backend and invalidates the cache. Rate limited to 10 requests per minute per IP.
{ "status": "success", "message": "content repository refreshed", "lastModified": "2026-07-13T...", "totalFiles": 42, "totalDirs": 8, "duration": "15ms"}Search
Section titled “Search”GET /search?q=your+queryFull-text search with relevance scoring:
- Exact title match: 100%
- Partial title match: 50%
- Content body match: 30%
Results include highlighted snippets with <mark> tags.
Sitemap
Section titled “Sitemap”GET /sitemap.xmlXML sitemap for search engines. Includes all non-draft pages with priority and changefreq metadata.
Robots
Section titled “Robots”GET /robots.txtRobots file for crawlers. Allows all user agents and points to the sitemap.
Metrics
Section titled “Metrics”GET /metricsPrometheus-format metrics for monitoring.
Cache Stats
Section titled “Cache Stats”GET /cache/statsReturns cache hit/miss statistics:
{ "hits": 100, "misses": 5, "hitRate": 0.95}Static Assets
Section titled “Static Assets”GET /static/*pathCSS, favicon, and other embedded assets. Served with immutable cache headers.
Live Reload (Dev Mode Only)
Section titled “Live Reload (Dev Mode Only)”GET /api/live-reloadServer-Sent Events endpoint for live reload. The browser connects and receives reload events when files change. Only available in dev mode (-dev flag).