CI / check (push) Successful in 29s
CI / tests-unit (push) Successful in 2m17s
CI / tests-integration (push) Successful in 2m29s
CI / tests-imaging-browsers (push) Successful in 2m32s
CI / tests-quality (push) Failing after 2m18s
CI / tests-ui (push) Successful in 5m14s
CI / preflight (push) Skipped
CI / deploy (push) Successful in 2m41s
26 lines
742 B
TypeScript
26 lines
742 B
TypeScript
import { resolveHotelName } from "@/lib/hotel-name";
|
|
import { buildNewsRss } from "@/lib/news-rss";
|
|
import { appBaseUrl } from "@/lib/seo";
|
|
import { getNewsList } from "@/lib/services/news-list";
|
|
|
|
// Built per request so the feed never needs a database connection during
|
|
// `next build`, matching the sitemap and robots routes.
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET() {
|
|
const [hotelName, items] = await Promise.all([
|
|
resolveHotelName(),
|
|
getNewsList(30),
|
|
]);
|
|
|
|
return new Response(
|
|
buildNewsRss(items, { hotelName, appUrl: appBaseUrl() }),
|
|
{
|
|
headers: {
|
|
"Content-Type": "application/rss+xml; charset=utf-8",
|
|
"Cache-Control": "public, s-maxage=300, stale-while-revalidate=600",
|
|
},
|
|
},
|
|
);
|
|
}
|