Permalink
Browse files

example which described what director the middleware expects your fil…

…es to be in.
  • Loading branch information...
1 parent c2b56a9 commit f8cd1318e3cf332476ed676f27d7aa08be1e6f77 @paulmars committed Dec 2, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 docs/middleware.md
View
@@ -37,7 +37,23 @@
.set('warn', true)
.set('compress', true);
}
-
+
+ Example:
+
+ styleLocation = join(__dirname + "/public")
+ cssLocation = join(__dirname + '/public')
+ console.log(styleLocation)
+ console.log(cssLocation)
+
+ connect.createServer(
+ stylus.middleware({ src: styleLocation, dest: cssLocation}),
+ connect.static(__dirname + '/public'),
+ ).listen 3000
+
+ This example expects the .styl files to be in the css directory. When the browser
+ requests /css/screen.css it will compile and serve a file from /css/screen.styl.
+ This is probably the simpliest configuration.
+
Pass the middleware to Connect, grabbing `.styl` files from this directory
and saving `.css` files to _./public_. Also supplying our custom `compile` function.

0 comments on commit f8cd131

Please sign in to comment.