README
fastify-favicon
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),
// and custom name; both options are optional
fastify.register(require('fastify-favicon'), { path: './test', name: 'icon.ico' })
fastify.listen(3000)
// curl http://127.0.0.1:3000/favicon.ico => returning the image, and no error thrown
Requirements
Fastify ^3.0.0 , Node.js 10.13.x or later. Note that plugin releases 2.x are for Fastify 2.x, 3.x are for Fastify 3.x, etc.
Note
Nothing.
Contributing
- Fork it ( https://github.com/smartiniOnGitHub/fastify-favicon/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
License
Licensed under Apache-2.0.