Namespace: fastifyFavicon

plugin~fastifyFavicon(fastifynon-null, optionsnon-null, donenon-null)

Plugin implementation.

Plugin implementation.
Parameters:
Name Type Description
fastify object Fastify instance
options object plugin configuration options
  • path (string, default `__dirname`) for the folder containing the icon,
  • name (string, default 'favicon.ico') for favicon file name,
  • maxAge (number, default 86400) for cache duration in seconds for the image,
done function callback, to call as last step
Source:

Methods

(inner) faviconRequestHandler(filenon-null) → {function}

Factory for the request handler for the favicon.

Factory for the request handler for the favicon.
Parameters:
Name Type Description
file object the icon file to send in the response
Source:
Returns:
the handler function, preconfigured with plugin settings and the file to send
Type
function