How to build a sitemap?

You cannot build a sitemap in the client side app because you don’t have direct access to the data. Rather you should build it in the API server using a worker process and upload it in a permanent storage like amazon S3. Then you ping Google or any other search engine with the link to the file stored in S3. You should also redirect /sitemap.xml asset requests to that link. You can rebuild the sitemap daily or weakly or monthly based on your needs.

To see how to build it in the API server, have a look at Rails’s sitemap generator implementation. The links generated by the sitemap generator must also match the routes defined in ember routes.

1 Like