From ab1969cc22fb7e2e2ec98432fdd3f0552f89d462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zbytovsk=C3=BD?= Date: Mon, 13 Nov 2023 21:52:53 +0100 Subject: [PATCH] general: sitemap experiment (#209) --- pages/sitemap.txt.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/sitemap.txt.tsx diff --git a/pages/sitemap.txt.tsx b/pages/sitemap.txt.tsx new file mode 100644 index 000000000..3d9db7cf4 --- /dev/null +++ b/pages/sitemap.txt.tsx @@ -0,0 +1,19 @@ +import { fetchText } from '../src/services/fetch'; + +const Sitemap = () => null; + +export const getServerSideProps = async ({ res }) => { + const content = await fetchText( + 'https://zbycz.github.io/osm-static/sitemap.txt', + ); + + res.setHeader('Content-Type', 'text/plain'); + res.write(content); + res.end(); + + return { + props: {}, + }; +}; + +export default Sitemap;