Respond status 200 application/xml /api/posts/urls

master
Raymonzut 4 years ago
parent 09a5a7438c
commit a8736826bf
No known key found for this signature in database
GPG Key ID: 1E9BCC39EDD1DD53
  1. 4
      server/routes/api/posts.js

@ -78,7 +78,9 @@ routes.set('/urls', async (req, res) => {
).join("\n") ).join("\n")
const xml = `<?xml version="1.0" encoding="UTF-8"?>\r<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> const xml = `<?xml version="1.0" encoding="UTF-8"?>\r<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${urls}\n\r</urlset>` ${urls}\n\r</urlset>`
res.send(xml)
res.header('Content-Type', 'application/xml')
res.status(200).send(xml)
}) })
module.exports = routes module.exports = routes

Loading…
Cancel
Save