This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
koa-robotstxt with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Koa middleware for serving the robots.txt file..
$ npm install koa-robotstxt
var koa = require('koa'); var robotstxt = require('koa-robotstxt'); var app = koa(); app.use(robotstxt(__dirname + '/public/robots.txt'));
Returns a middleware serving the robots.txt found on the given
maxAgecache-control max-age directive in ms, defaulting to 1 day.