Skip to content

Instantly share code, notes, and snippets.

@Quby
Created August 28, 2012 16:30
Show Gist options
  • Save Quby/3500040 to your computer and use it in GitHub Desktop.
Save Quby/3500040 to your computer and use it in GitHub Desktop.
Hm, too sugar
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"
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