Created
August 28, 2012 16:30
-
-
Save Quby/3500040 to your computer and use it in GitHub Desktop.
Hm, too sugar
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" | |
views = require "connect-views" | |
class app extends express | |
configure:-> | |
@set "port", 3000 | |
@set "views", "#{__dirname}/views" | |
@set "view engine", "jade" | |
@use express.bodyParser() | |
@use @router | |
@use views | |
class exports.production extends app | |
configure:-> | |
super() | |
@enable "view cache" | |
class exports.development extends app | |
configure:-> | |
super() | |
@use express.logger "dev" | |
@use express.errorHandler | |
@use express.static "#{__dirname}/public" |
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" | |
views = require "connect-views" | |
app = express() | |
app.configure -> | |
app.set "port", 3000 | |
app.set "views", "#{__dirname}/views" | |
app.set "view engine", "jade" | |
app.use express.bodyParser() | |
app.use app.router | |
app.use views | |
root: "public" | |
stylus: | |
paths: "stylesheets" | |
app.configure "production", -> | |
app.enable "view cache" | |
app.configure "development", -> | |
app.use express.logger "dev" | |
app.use express.errorHandler() | |
app.use express.static "#{__dirname}/public" | |
module.exports = app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment