Created
September 22, 2011 05:41
-
-
Save monokrome/1234138 to your computer and use it in GitHub Desktop.
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
express = require 'express' | |
stylus = require 'stylus' | |
path = require 'path' | |
public_dir = (filename) -> path.join __dirname, '../public', filename or '' | |
get_stylus_options = (server) -> | |
stylus_options = | |
compress: server.env == 'production' | |
debug: server.env != 'production' | |
force: server.env != 'production' | |
linenos: server.env != 'production' | |
firebug: server.env != 'production' | |
src: path.join __dirname, 'styles' | |
dest: public_dir 'styles' | |
exports.apply = (server) -> | |
server.use express.static public_dir() | |
server.use stylus.middleware get_stylus_options server | |
server.set 'views', public_dir 'views' | |
server.configure 'production', -> | |
this.set 'listening-port', process.env.NODE_PORT || 80 | |
server.configure 'development', -> | |
this.set 'listening-port', process.env.NODE_PORT || 8000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment