Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honzahommer/request-robots
An express.js middleware for handling noisy robots.txt
https://github.com/honzahommer/request-robots
express express-middleware middleware nodejs npm request robots-txt
Last synced: 2 days ago
JSON representation
An express.js middleware for handling noisy robots.txt
- Host: GitHub
- URL: https://github.com/honzahommer/request-robots
- Owner: honzahommer
- License: mit
- Created: 2017-08-10T22:50:50.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:14:15.000Z (almost 2 years ago)
- Last Synced: 2024-10-03T03:21:40.130Z (about 1 month ago)
- Topics: express, express-middleware, middleware, nodejs, npm, request, robots-txt
- Language: JavaScript
- Size: 1.76 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# request-robots
[![npm version][npm-image]][npm-url]
[![npm download][downloads-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Greenkeeper badge](https://badges.greenkeeper.io/honzahommer/request-robots.svg)](https://greenkeeper.io/)> An express.js middleware for handling noisy robots.ico
Modern browsers usually asks for robots of the website. Having a robots in a Web page is a good thing (normally).
However it is not always desired and sometime developers need a way to avoid the extra payload.
Nice way to handle that is to send 204 status code for `/robots.txt` requests.
## Install
```sh
npm install request-robots
```## Example
```javascript
const express = require('express');
const robots = require('request-robots');const app = express();
app.use(robots());// Add your routes here, etc.
app.listen(3000);
```## License
[MIT](LICENSE)
[npm-image]: https://img.shields.io/npm/v/request-robots.svg
[npm-url]: https://npmjs.org/package/request-robots
[travis-image]: https://img.shields.io/travis/honzahommer/request-robots/master.svg
[travis-url]: https://travis-ci.org/honzahommer/request-robots
[downloads-image]: https://img.shields.io/npm/dm/request-robots.svg