1 | /*!
|
2 | * Connect - favicon
|
3 | * Copyright(c) 2010 Sencha Inc.
|
4 | * Copyright(c) 2011 TJ Holowaychuk
|
5 | * MIT Licensed
|
6 | */
|
7 |
|
8 | /**
|
9 | * Module dependencies.
|
10 | */
|
11 |
|
12 | var path = require('path');
|
13 | var serveFavicon = require('serve-favicon');
|
14 |
|
15 | var defaultPath = path.join(__dirname, '..', 'public', 'favicon.ico');
|
16 |
|
17 | /**
|
18 | * Favicon:
|
19 | *
|
20 | * By default serves the connect favicon, or the favicon
|
21 | * located by the given `path`.
|
22 | *
|
23 | * See [serve-favicon](https://github.com/expressjs/serve-favicon)
|
24 | *
|
25 | * @param {String|Buffer} path
|
26 | * @param {Object} options
|
27 | * @return {Function}
|
28 | * @api public
|
29 | */
|
30 |
|
31 | module.exports = function favicon(path, options){
|
32 | path = path || defaultPath;
|
33 | return serveFavicon(path, options);
|
34 | };
|