Twitter Bootstrap LESS with Node.js & Express

前端 未结 2 1563
既然无缘
既然无缘 2020-12-24 02:25

Since Twitter Bootstrap 2 is out, I wanted to integrate that into my Node.js project. Unfortunately, there\'s something wrong with the less compiler and I can\'t get it to w

2条回答
  •  孤城傲影
    2020-12-24 03:11

    For posterity, this has changed a lot in recent Express:

    app.use(require('less-middleware')({ src: __dirname + '/public' }));
    app.use(express.static(path.join(__dirname, 'public')));
    
    // This is just boilerplate you should already have
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    

提交回复
热议问题