This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ProgBlog/app/config/view-engine.js

18 lines
482 B
JavaScript
Raw Normal View History

2016-02-19 12:58:16 -05:00
'use strict';
2016-02-19 16:17:59 -05:00
const handlebars = require('express-handlebars');
2016-02-19 12:58:16 -05:00
const path = require('path');
module.exports.setup = (app) => {
2016-02-19 16:17:59 -05:00
const baseViewDir = path.resolve(__dirname, '../views');
app.set('views', baseViewDir);
app.engine('.stache', handlebars({
defaultLayout: 'blog',
extname: '.stache',
layoutsDir: `${baseViewDir}/layouts/`,
partialsDir: `${baseViewDir}/partials/`,
}));
// use .stache files as a default view extension
app.set('view engine', '.stache');
2016-02-19 12:58:16 -05:00
};