Skip to content

Instantly share code, notes, and snippets.

@Bachana123
Created January 27, 2020 10:06
Show Gist options
  • Save Bachana123/e4f6cec75d9e9cf26c4fe9552a6fdab6 to your computer and use it in GitHub Desktop.
Save Bachana123/e4f6cec75d9e9cf26c4fe9552a6fdab6 to your computer and use it in GitHub Desktop.
const Axios = require('axios')
sitemap: {
routes: async () => {
const { data } = await Axios.get('here comes you API', { headers: {
'Accept-Language' : 'ka'
}})
return data.data.map(x => ({
changefreq: x.frequency,
priority: x.priority,
lastmod: x.lastModified,
url: x.url,
}))
},
path: '/sitemap.xml',
filter ({routes}) {
return routes.filter(x => !!x.priority)
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment