All Projects → koajs → favicon

koajs / favicon

Licence: other
Koa middleware for serving a favicon

Programming Languages

javascript
184084 projects - #8 most used programming language

koa-favicon Build Status

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

Installation

$ npm install koa-favicon

Example

const Koa = require('koa');
const favicon = require('koa-favicon');
const app = new 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.
  • mime specify the mime-type of the favicon, defaults to "image/x-icon"

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].