Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 在express中使用dotjs_Node.js_Express_Dotjs - Fatal编程技术网

Node.js 在express中使用dotjs

Node.js 在express中使用dotjs,node.js,express,dotjs,Node.js,Express,Dotjs,我想用它来代替翡翠快递 我变了 app.set('view engine', 'jade'); 到 但是它很长一段时间没有加载,我也没有得到响应 有什么问题吗?一个简单的方法是使用快速点: npm install express-dot 在你的app.js中: var doT = require('express-dot'); // (optional) set globals any thing you want to be exposed by this in {{= }} and in

我想用它来代替翡翠快递

我变了

app.set('view engine', 'jade');

但是它很长一段时间没有加载,我也没有得到响应


有什么问题吗?

一个简单的方法是使用快速点:

npm install express-dot
在你的app.js中:

var doT = require('express-dot');
// (optional) set globals any thing you want to be exposed by this in {{= }} and in def {{# }}
doT.setGlobals({ ... });
app.set('view engine', 'dot' );
app.engine('dot', doT.__express );
当然,有人建议像亨利将军所说的那样撰写自己的作品。
因为如果你这样做,你会更好地理解express和dot。
express dot不支持预编译,因此我在Github repo中有一个简单的
祝你好运。

你是说?你打算如何在Express中使用它?这是一个Chrome扩展…他的意思是看一看降价的例子,你需要像这样组合你的中间件
var doT = require('express-dot');
// (optional) set globals any thing you want to be exposed by this in {{= }} and in def {{# }}
doT.setGlobals({ ... });
app.set('view engine', 'dot' );
app.engine('dot', doT.__express );