Fastify Plugin to serve default favicon
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
src
test
.dockerignore
.editorconfig
.gitignore
.npmignore
CHANGELOG.md
LICENSE
NOTICE
README.md
package.json

README.md

fastify-favicon

NPM Version NPM Downloads Code Style Coverage Status

Fastify Plugin to serve default favicon.

With this plugin, Fastify will have a route configured for /favicon.ico requests.

Usage

const fastify = require('fastify')()

// example without specifying options, searching favicon.ico from project root, otherwise returning a default favicon
fastify.register(require('fastify-favicon'))
// or
// example with custom path, usually relative to project root, but could be absolute
fastify.register(require('fastify-favicon'), { path: './test' })

fastify.listen(3000)
// curl http://127.0.0.1:3000/favicon.ico => returning the image, and no error thrown

Requirements

Fastify ^1.1.0 . Node.js 8.14.x or later.

Note

Nothing.

Contributing

  1. Fork it ( https://github.com/smartiniOnGitHub/fastify-favicon/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

Licensed under Apache-2.0.