All files / server/plugins/favicon index.js

100% Statements 3/3
100% Branches 4/4
100% Functions 1/1
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2027x   27x                       135x          
const favicon = require('serve-favicon');
 
module.exports = {
  name: 'favicon',
  options: {
    __root: 'location',
    location: {
      type: String,
      file: true,
      env: 'FAVICON'
    }
  },
 
  before: [
    ctx => ctx.options.favicon && ctx.options.favicon.location
      ? ctx.utils.modern(favicon(ctx.options.favicon.location))(ctx)
      : false
  ]
};