node package manager

koa-favicon

koa-favicon Build Status

Koa middleware for serving a favicon. Based on serve-favicon.

Installation

$ npm install koa-favicon

Example

var koa = require('koa');
var favicon = require('koa-favicon');
var app = koa();
 
app.use(favicon(__dirname + '/public/favicon.ico'));

API

favicon(path, [options])

Returns a middleware serving the favicon found on the given path.

options

  • maxAge cache-control max-age directive in ms, defaulting to 1 day.

License

MIT