33 lines
427 B
JavaScript
Raw Normal View History

2015-10-01 00:30:16 +02:00
'use strict';
/**
* X-Response-Time hook
*/
module.exports = function (strapi) {
const hook = {
/**
* Default options
*/
defaults: {
responseTime: true
},
/**
* Initialize the hook
*/
initialize: function (cb) {
if (strapi.config.responseTime === true) {
strapi.app.use(strapi.middlewares.responseTime());
}
cb();
}
};
return hook;
};