Vercel/app/feed.json/route.ts
Sam Becker 70f6f48044
Exclude photo from feeds (#280)
* Add tooltip to 'hidden' checkbox

* Refine checkbox UI

* Allow photos to be excluded from main feeds

* Fix footer grid in photos excluded from feed

* Apply feed exclusion from batch upload

* Scrub final hidden/private language

* Add visibility icons to admin photo menu
2025-07-05 23:40:58 -05:00

18 lines
535 B
TypeScript

import { getPhotosCached } from '@/photo/cache';
import { SITE_FEEDS_ENABLED } from '@/app/config';
import { formatFeedJson } from '@/feed/json';
import { PROGRAMMATIC_QUERY_OPTIONS } from '@/feed';
// Cache for 24 hours
export const revalidate = 86_400;
export async function GET() {
if (SITE_FEEDS_ENABLED) {
const photos = await getPhotosCached(PROGRAMMATIC_QUERY_OPTIONS)
.catch(() => []);
return Response.json(formatFeedJson(photos));
} else {
return new Response('Feeds disabled', { status: 404 });
}
}