mirror of
https://github.com/waynesutton/markdown-site.git
synced 2026-01-12 04:09:14 +00:00
feat(api): add /api/raw/:slug endpoint for AI tools (ChatGPT, Claude, Perplexity)
- Create netlify/functions/raw.ts Netlify Function - Returns text/plain with minimal headers for reliable AI ingestion - Reads from dist/raw/ (production) or public/raw/ (dev/preview) - Update CopyPageDropdown to use /api/raw/:slug for AI services - Keep /raw/:slug.md for View as Markdown browser viewing - Add @netlify/functions dev dependency
This commit is contained in:
@@ -5,6 +5,13 @@
|
||||
[build.environment]
|
||||
NODE_VERSION = "20"
|
||||
|
||||
# API raw markdown endpoint for AI tools (ChatGPT, Claude, Perplexity)
|
||||
[[redirects]]
|
||||
from = "/api/raw/*"
|
||||
to = "/.netlify/functions/raw/:splat"
|
||||
status = 200
|
||||
force = true
|
||||
|
||||
# Raw markdown passthrough - explicit rule prevents SPA fallback from intercepting
|
||||
[[redirects]]
|
||||
from = "/raw/*"
|
||||
|
||||
Reference in New Issue
Block a user