【发布时间】:2015-05-12 03:23:42
【问题描述】:
谁能帮我编译我的css。我不知道为什么我的观点没有得到编译较少
Index.js
// MIDDLEWARE
var express = require('express');
var less = require('less-middleware');
var app = express();
// LESS COMPILER
app.use(less('source/less', {
"dest": 'public/stylesheets',
"pathRoot": __dirname,
"force": true,
"render": {
"yuicompress": true
}
}));
// APP CONFIG
app.use(express.static(__dirname + '/public'));
app.set('views', 'views')
app.set('view engine', 'jade');
// ROUTES
app.get('/', function (req, res) {
res.render('index');
});
// PAGE NOT FOUND
app.use(function(req, res, next) {
res.status(404).send('Sorry cant find that!');
});
// WEB SERVER
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Example app listening at http://%s:%s', host, port);
});
Index.jade
html
head
title Hello
link(src="stylesheets/global.css" type="text/css")
body
h1 Welcome
【问题讨论】: