Skip to content

Instantly share code, notes, and snippets.

@maximilianfixl
Last active December 28, 2022 08:33
Show Gist options
  • Save maximilianfixl/e4e93fcb05c954de2f7807c968a18d31 to your computer and use it in GitHub Desktop.
Save maximilianfixl/e4e93fcb05c954de2f7807c968a18d31 to your computer and use it in GitHub Desktop.
const data = await axios.get(`${ process.env.API_URL }/listings/sitemap`).then(res => {
return res.data.map(listing => {
// check for listing id and seo_title
if (listing && listing.id && listing.seo_title) {
return {
url: `/apartment/${ listing.id }/${ listing.seo_title }/`,
payload: listing,
lastmod: listing.lastUpdated
}
}
})
})
const regions = await axios.get(`${ process.env.API_URL }/search/regions_base_flat`).then(res => {
return res.data.map(region => {
// check for region link
if (region && region.link) {
return {
url: region.link,
payload: region,
changefreq: 'daily',
priority: 1
}
}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment