Created
January 27, 2020 10:06
-
-
Save Bachana123/e4f6cec75d9e9cf26c4fe9552a6fdab6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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