Skip to content

Commit

Permalink
Fixed middleware docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Apr 28, 2012
1 parent 7ba0a49 commit 0a3a8ad
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/middleware.md
Expand Up @@ -41,19 +41,20 @@
Pass the middleware to Connect, grabbing `.styl` files from this directory
and saving `.css` files to _./public_. Also supplying our custom `compile` function.

Following that, we have a `staticProvider` layer setup to serve the `.css`
Following that, we have a `static` layer setup to serve the `.css`
files generated by Stylus.

var stylus = require('stylus');

var server = connect.createServer(
stylus.middleware({
src: __dirname
, dest: __dirname + '/public'
, compile: compile
})
, connect.staticProvider(__dirname + '/public')
);
var app = connect();

app.use(stylus.middleware({
src: __dirname
, dest: __dirname + '/public'
, compile: compile
}));

app.use(connect.static(__dirname + '/public'));

When `force` is used, the styles will unconditionally be re-compiled. But even without this option, the Stylus middleware is smart enough to detect changes in `@import`ed files.

Expand Down

0 comments on commit 0a3a8ad

Please sign in to comment.