1

Can you please tell me where to place robots.txt and sitemap.xl in nodejs express project folder structure so that it will be available to search engines.

I placed it along with app.js and inside public folder,but i got "Cannot GET /sitemap.xml" error in both the case

Sona Shetty
  • 997
  • 3
  • 18
  • 41
  • Possible duplicate of [What is the smartest way to handle robots.txt in Express?](https://stackoverflow.com/questions/15119760/what-is-the-smartest-way-to-handle-robots-txt-in-express) – Mark Oct 26 '17 at 18:27

1 Answers1

2

Have you set the route for your public folder, the one that is shared or served to the public?

like for example:

app.use(express.static('public'))

All the content inside the folder: "public" like html,css or robots.txt will be served.

RocketFuel
  • 52
  • 6