我是新來的把手,我正在嘗試使用SWAG庫作爲自定義幫助程序,但未成功。 例如,我嘗試在我的file.handlebars {{小寫的「BENDER不應該被允許ON TV」}}顯示和我得到的錯誤錯誤:找不到屬性「小寫」 我跑NPM安裝贓物把手SWAG庫
我app.js是:
var express = require('express')
, http = require('http')
, routes = require('./routes')
, path = require('path')
,Swag = require('swag')
, handlebars = require('handlebars');
var app = express();
var engines = require('consolidate');
app.engine('handlebars', engines.handlebars);
app.configure(function() {
app.set('view engine', 'handlebars');
app.set('views', __dirname + '/views');
app.set('port', process.env.PORT || 3000);
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});
app.get('/dashBoard', routes.getDashboard);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
預先感謝您的幫助
西拉斯