Created
April 10, 2012 23:37
-
-
Save andyj/2355649 to your computer and use it in GitHub Desktop.
Express, Less and less-middleware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir expressWithLess && cd expressWithLess | |
$ express --css less-middleware && npm install | |
$ mv public/stylesheets/ public/styles | |
$ nano public/styles/style.less | |
@color: #00B7FF; | |
body { padding: 200px; font: 18px "Lucida Grande", Helvetica, Arial, sans-serif; } | |
a { color: @color; } | |
$ nano app.js | |
var lessMiddleware = require('less-middleware'); | |
Update the configuration: | |
app.configure(function () { | |
// Other configuration here... | |
app.use(lessMiddleware({ | |
src: __dirname + '/public', | |
compress: true | |
})); | |
}); | |
$ nano views/layout.jade | |
Change /stylesheets/style.css to /styles/style.css | |
$ rm public/styles/style.css | |
$ node app.js | |
go to http://localhost:3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scouring the internet, and this is what helped me get Express + Less working