Permalink
Browse files

move back to express so we can utilize production config. enable stat…

…ic cache in production mode.
  • Loading branch information...
1 parent 435b606 commit d925b628dfefc9ba9165aef00b3b8625c79349ba Simeon Bateman committed Feb 5, 2013
Showing with 12 additions and 7 deletions.
  1. +2 −2 package.json
  2. +10 −5 src/server.coffee
View
@@ -2,7 +2,7 @@
"author": "Simeon Bateman <simeon@simb.net> (http://www.simb.net)"
, "name": "httpster"
, "description": "Simple http server for local content"
- , "version": "0.3.2"
+ , "version": "0.4.0"
, "repository": "git://github.com/SimbCo/httpster.git"
, "keywords": ["http", "web", "server"]
, "main": "./lib/httpster"
@@ -12,7 +12,7 @@
"postinstall": "coffee -o lib/ src/",
"test": "make test" }
, "dependencies": {
- "connect": "2.7.0",
+ "express": "3.0.x",
"commander": "1.1.1",
"coffee-script": "1.2.0"
}
View
@@ -9,7 +9,7 @@
fs = require('fs')
program = require('commander')
exec = require('child_process').exec
-connect = require('connect')
+express = require('express')
path = "./"
port = undefined
fav = require('./fav')
@@ -25,12 +25,17 @@ path = program.dir ? fs.realpathSync(path)
startDefaultServer = (port, path) ->
- app = connect()
+ app = express()
app.use( fav(path) )
- app.use connect.static(path)
- app.use connect.logger(format:"dev")
- app.use connect.errorHandler(dumpExceptions: true, showStack: true)
+ app.use express.static(path)
+ app.use express.logger(format:"dev")
+ app.use express.errorHandler(dumpExceptions: true, showStack: true)
+
+ # production only
+ app.configure('production', ->
+ app.use express.staticCache()
+ )
#app.use '/', (req, res) -> res.render('index.html')
app.listen(parseInt(port, 10))

0 comments on commit d925b62

Please sign in to comment.