@akemona-org/strapi
Version:
An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite
33 lines (26 loc) • 510 B
JavaScript
;
/**
* Module dependencies
*/
// Node.js core.
const { resolve } = require('path');
const favicon = require('koa-favicon');
/**
* Favicon hook
*/
module.exports = (strapi) => {
return {
/**
* Initialize the hook
*/
initialize() {
const { dir } = strapi;
const { maxAge, path: faviconPath } = strapi.config.middleware.settings.favicon;
strapi.app.use(
favicon(resolve(dir, faviconPath), {
maxAge,
})
);
},
};
};