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;