包详细信息

koa-favicon

koajs838.3kMIT2.1.0

favicon bounce middleware for koa

koa, middleware, favicon

自述文件

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

更新日志

2.1.0 / 2020-02-27

  • Support and test for specifying mime type of icon (#30)
  • bump deps

2.0.1 / 2018-03-18

  • bump deps

1.2.0 / 2014-09-23

  • use mz instead of co-fs

1.1.0 / 2014-05-05

  • add favicon serving

1.0.1 / 2013-12-21

  • update to new koa middleware signature