loopback/server/middleware/favicon.js

18 lines
489 B
JavaScript
Raw Normal View History

// Copyright IBM Corp. 2014,2018. All Rights Reserved.
2016-05-03 22:50:21 +00:00
// Node module: loopback
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT
'use strict';
const favicon = require('serve-favicon');
const path = require('path');
2014-11-24 23:08:21 +00:00
/**
* Serve the LoopBack favicon.
* @header loopback.favicon()
*/
module.exports = function(icon, options) {
icon = icon || path.join(__dirname, '../../favicon.ico');
return favicon(icon, options);
};