Skip to content

robots.txt middleware for express/connect to server up your robots.txt

Notifications You must be signed in to change notification settings

balaclark/robots.txt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robots.txt

Pass in the location of your robots.txt file on the file system, and this module will return you a piece of Connect/Express middleware that will serve it at GET /robots.txt.

This makes one synchronous call to read the file upon start up, then reads it from memory for every request. If you gave the wrong path, you will know about it at startup. Cache headers are set for you.

Installation

npm install --save robots.txt

Usage

var robots = require('robots.txt')

// Pass in the absolute path to your robots.txt file
app.use(robots(__dirname + '/robots.txt'))

Credits

Built by Tom Gallacher and Ben Gourley

Licence

Licensed under the New BSD License

About

robots.txt middleware for express/connect to server up your robots.txt

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%