config.default.js 873 B

12345678910111213141516171819202122
  1. 'use strict';
  2. const path = require('path');
  3. module.exports = appInfo => ({
  4. /**
  5. * view default config
  6. * @member Config#view
  7. * @property {String} [root=${baseDir}/app/view] - give a path to find the file, you can specify multiple path with `,` delimiter
  8. * @property {Boolean} [cache=true] - whether cache the file's path
  9. * @property {String} [defaultExtension] - defaultExtension can be added automatically when there is no extension when call `ctx.render`
  10. * @property {String} [defaultViewEngine] - set the default view engine if you don't want specify the viewEngine every request.
  11. * @property {Object} mapping - map the file extension to view engine, such as `{ '.ejs': 'ejs' }`
  12. */
  13. view: {
  14. root: path.join(appInfo.baseDir, 'app/view'),
  15. cache: true,
  16. defaultExtension: '.html',
  17. defaultViewEngine: '',
  18. mapping: {},
  19. },
  20. });