Created
August 30, 2011 18:38
-
-
Save marlun/1181652 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
stylus = require 'stylus' | |
path = require 'path' | |
express = require 'express' | |
app = express.createServer() | |
public_dir = path.join __dirname, 'public' | |
styles_dir = path.join public_dir, 'styles' | |
# Setup stylus compiler | |
compile = (str, path) -> | |
stylus(str).set('filename', path).set('compress', true) | |
app.set 'views', __dirname + '/views' | |
app.set 'view engine', 'ejs' | |
app.set 'view options', layout: false | |
app.use express.logger() | |
app.use express.bodyParser() | |
app.use app.router | |
app.use stylus.middleware src: styles_dir, dest: styles_dir, compile: compile | |
app.use express.compiler src: public_dir, dest: public_dir, enable: ['coffeescript'] | |
app.use express.static public_dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment