Is there any way to use multiple view engines with Express + Node.js

前端 未结 3 1395
说谎
说谎 2020-12-01 05:39

Scenario: I had developed some transactional pages using Node.js, Express + Handlebars as view engine and MongoDB.

Now the issue is during module in

3条回答
  •  甜味超标
    2020-12-01 06:22

    1. Add both engines and consolidate.js in your package.json
    2. In yourapp.js

      var engines = require('consolidate');

      app.engine('jade', engines.jade);

      app.engine('handlebars', engines.handlebars);

    More info here

提交回复
热议问题