Is it considered bad practice to use HTML in Jade?

前端 未结 3 1490
再見小時候
再見小時候 2021-01-30 17:29

Jade looks like a cool templating engine and I think I\'ll be using it for my next project. However, some of the syntax doesn\'t make sense to me.

What do you get by doi

3条回答
  •  不知归路
    2021-01-30 17:45

    you can use the following approach too to use plain html as your view engine.

    app.set('views', path.join(__dirname, '/path/to/your/folder'));
    app.set("view options", {layout: false});
    app.engine('html', function(path, opt, fn) {
      fs.readFile(path, 'utf-8', function(error, str) {
          if (error)
              return str;
          return fn(null, str);
      });
    

    });

提交回复
热议问题