koa-favicon
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/koa-favicon package

2.1.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.1.0
    110,089
    • latest
  • 2.0.0
    152
    • next

Version History

Package Sidebar

Install

npm i koa-favicon

Weekly Downloads

111,288

Version

2.1.0

License

MIT

Unpacked Size

3.06 kB

Total Files

4

Last publish

Collaborators

  • coderhaoxin
  • aaron
  • juliangruber
  • eivifj
  • dead_horse
  • tjholowaychuk
  • jongleberry
  • fengmk2