发布于 2016-05-23 13:21:07
好吧,我明白了。sitemap.js做了这件事。我的代码:
const sm = require('sitemap');
const sitemap = sm.createSitemap({
hostname: 'http://' + req.vhost.host,
cacheTime: 600000
});
sitemap.add({
url: '/page1',
changefreq: 'weekly',
priority: 1.0
});
res.header('Content-Type', 'application/xml');
res.send(sitemap.toString());
https://stackoverflow.com/questions/37212102
复制相似问题