[SSS] Creating a sitemap
Sitemaps are used by search engines to know what pages to crawl; they're basically a list of all the URLs available on a website. Last time we saw how to manually create an RSS feed by manually creating an XML document, and a sitemap is also just an XML document.
First, let's add the route to our droplet:
func addRoutes() -> Droplet {
get("/sitemap.xml", handler: SitemapController.create)
// [...]
}As we saw in the previous post, we need a controller that has a method with the same signature as the handler: