Files
profile-front/src/pages/news/[...slug].astro
Andrey Kuvshinov 033158e384 add new routing
2025-12-17 23:05:49 +03:00

31 lines
567 B
Plaintext

---
import MainLayout from '@layouts/MainLayout.astro';
import { getNodeByURI, getCategoryPosts } from '@lib/api/all';
export const prerender = false;
const { slug } = Astro.params;
const uri = slug ? `/${slug}` : '/';
let response;
let node = null;
try {
response = await getNodeByURI(uri);
node = response?.nodeByUri;
} catch (error) {
console.error('Error fetching node:', error);
}
// ISR кэширование
//Astro.response.headers.set(
// 'Cache-Control',
// 'public, s-maxage=3600, stale-while-revalidate=86400'
//);
---
News
<p>{uri}</p>