npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

express-robots-middleware

1.0.1 • Public • Published

express-robots-middleware

Build Status

Middleware for generating robots.txt in Express

Installation

npm i express-robots-middleware --save

Features

  • Multiple User Agents
  • Multiple Allow/Disallow
  • Crawl-delay argument

Usage

Simple initialize and assign the middleware to a route and pass in your robots.txt options see mock.js for a working example.

const robotsMiddleware = expressRobotsMiddleware({
  UserAgent: '*',
  Disallow: ['/private'],
  Allow: '/',
  CrawlDelay: '5'
}]);

app.get('/robots.txt', robotsMiddleware);

License

MIT

install

npm i express-robots-middleware

Downloadsweekly downloads

56

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability