trailpack-proxy-sitemap
Sitemap for Proxy Engine. Creates a sitemap.xml available at /sitemap.xml
, and rebuilds on a cron schedule.
Install
$ npm install --save trailpack-proxy-sitemap
Configure
// config/main.jsmoduleexports = packs: // ... other trailpacks
// config/proxySitemap.jsmoduleexports = host: 'https://<hostname>' cache: 1000000
Creating a Sitemap
Sitemaps are created in the /api/sitemaps
. Create one or many methods that return a Promise and array like the one below. Under the hood, Proxy Sitemap uses Sitemap for more examples on acceptable returns.
The sitemap is broken into methods so that it can deliver multiple sitemaps if necessary and break them up accordingly.
const Sitemap = Sitemap moduleexports = { return Promise }