Search code examples
vue.jsnuxt.jsxml-sitemap

Nuxt return sitemap.xml route with async data


Is there a way to get async data for XML from API and then display it as website.com/sitemap.xml ?


Solution

  • No you cannot... but take a look to the nuxt sitemap module

    you can use the routes option to load async data (see eg. https://sitemap.nuxtjs.org/usage/sitemap-options#from-a-function-which-returns-a-promise)