当我尝试将静态目录添加到我的代码中时,我收到此错误:
TypeError: cannot call method 'forEach' of undefined
任何人都可以帮我吗?
['adobeair','applewebkit','bs3','chrome','css','font-awesome','hpwos','images','img','js', 'Opera', 'plugins'].forEach(function (dir)
{
app.use('/template/'+dir, connect.static(__dirname+'/template/'+dir));
});
由于
答案 0 :(得分:0)
最佳方式 -
var dirs = ['adobeair','applewebkit','bs3','chrome','css','font-awesome','hpwos','images','img','js', 'Opera', 'plugins'];
dirs.forEach(function(dir) {
console.log('dir name : '+dir);
});
它正在工作或我:)