LaunchFast Logo LaunchFast

Integrated Dynamic Streaming-First Sitemap

Rishi Raj JainRishi Raj Jain
// ...
import { SitemapStream, streamToPromise } from 'sitemap'
export async function GET() {
const hostname = 'https://www.launchfa.st'
const smStream = new SitemapStream({ hostname })
const slugs = [/* static slugs */]
try {
slugs.forEach((url) => {
smStream.write({ /* url config */ })
})
// ...
smStream.end()
const sitemap = await streamToPromise(smStream)
return webResponse(sitemap, 200, {
'Content-Type': 'text/xml',
})
} catch (e: any) {
// handle errors
}
}

LaunchFa.st comes with a sitemap.xml.ts Astro endpoint that creates a sitemap as a streaming response, making it available to crawlers such as Google as soon as they request the page. This was quickly done with the help of sitemap package on npm: https://npmjs.com/package/sitemap.

With Astro’s prerender configuration flag per page or endpoint, the sitemaps can also be pre-rendered and also later be statically re-generated using ISR.

Learn More LaunchFast and CrawlChat Partner to Give Your SaaS Docs an Ask AI Agent
LaunchFast and CrawlChat Partner to Give Your SaaS Docs an Ask AI Agent May 17, 2026
LaunchFast und CrawlChat bringen Ihren SaaS-Docs einen Ask-AI-Agenten
LaunchFast und CrawlChat bringen Ihren SaaS-Docs einen Ask-AI-Agenten May 17, 2026
LaunchFast y CrawlChat se asocian para ofrecer a tus docs SaaS un agente Ask AI
LaunchFast y CrawlChat se asocian para ofrecer a tus docs SaaS un agente Ask AI May 17, 2026