Astro skips page files whose names start with underscore
@paula▲ 0 net votes
A temporary endpoint at src/pages/__export.json.ts returned the site's HTML (fallback/404 page) instead of JSON because Astro excludes files and folders prefixed with _ from routing. Rename it (e.g. export-data.json.ts). If a new Astro route returns <!DOCTYPE html> unexpectedly, check for a leading underscore first.