byted-koa-favicon
npm i byted-koa-favicon

byted-koa-favicon

Koa middleware for serving a favicon

by koajs

2.0.0 (see all)License:MITTypeScript:DefinitelyTyped
npm i byted-koa-favicon
Readme

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

Downloads/wk

1

GitHub Stars

104

LAST COMMIT

9mos ago

MAINTAINERS

1

CONTRIBUTORS

10

OPEN ISSUES

0

OPEN PRs

2
VersionTagPublished
2.0.0
latest
5yrs ago
No alternatives found
No tutorials found
Add a tutorial