UNPKG

732 BTypeScriptView Raw
1/* =================== USAGE ===================
2
3 import serveFavicon = require('serve-favicon');
4 app.use(serveFavicon(__dirname + '/public/favicon.ico'));
5
6 =============================================== */
7
8import express = require("express");
9
10/**
11 * Node.js middleware for serving a favicon.
12 */
13declare function serveFavicon(
14 path: string | Buffer,
15 options?: serveFavicon.Options,
16): express.RequestHandler;
17
18declare namespace serveFavicon {
19 interface Options {
20 /**
21 * The cache-control max-age directive in ms, defaulting to 1 year.
22 * This can also be a string accepted by the `ms` module.
23 */
24 maxAge?: number | string | undefined;
25 }
26}
27
28export = serveFavicon;