简体   繁体   English

较少的中间件不起作用-“ Express 500错误:无法识别的输入”

[英]less-middleware does't work - “Express 500 Error: Unrecognised input”

I'm using Express framework with less-middleware and jade template engine 我正在使用带有较少中间件和Jade模板引擎的Express框架

When I'm trying to get my css file in browser "/css/style.css" - I get the error "Express 500 Error: Unrecognised input" 当我尝试在浏览器“ /css/style.css”中获取css文件时,出现错误“ Express 500 Error:Unrecognized input”

Here is basic setup in app.js 这是app.js中的基本设置

var app = express();

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.set('view options', {
    layout: false
});
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(require('less-middleware')({ src: __dirname + '/public' }));
app.use(express.static(path.join(__dirname, 'public')));
app.use(app.router);


// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

app.get("/api/places", api.getAllPlaces);
app.get("/api/place/:id", api.getOnePlace);

app.all('*', routes.index);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

Any help appreciated! 任何帮助表示赞赏! Thanks. 谢谢。

That was just typo in *.less file. 那只是* .less文件中的错字。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM