Permalink
Browse files

added express server for localhost preview

  • Loading branch information...
1 parent a988d2a commit cfb713c6e093e203f9101f635463f4532861b5f7 @srohde committed Apr 1, 2013
Showing with 24 additions and 1 deletion.
  1. +23 −0 app.coffee
  2. +1 −0 package.json
  3. +0 −1 src/coffeescripts/Main.coffee
View
@@ -0,0 +1,23 @@
+express = require 'express'
+http = require 'http'
+path = require 'path'
+
+app = module.exports = express()
+
+app.configure ->
+ app.set 'port', process.env.PORT or 4000
+ app.use express.logger('dev')
+ app.use express.compress()
+ app.use express.bodyParser()
+ app.use express.methodOverride()
+ app.use app.router
+ app.use express.static(path.join(__dirname, 'www'))
+
+app.configure 'development', ->
+ app.use express.errorHandler { dumpExceptions: true, showStack: true }
+
+app.configure 'production', ->
+ app.use express.errorHandler()
+
+app.listen app.get('port')
+console.log("Express server on port #{app.get('port')}");
View
@@ -6,6 +6,7 @@
},
"version": "0.0.1",
"dependencies": {
+ "express": ">=3.1.0",
"growl": "*",
"hogan.js": ">=2.0.0",
"stylus": ">=0.31.0",
@@ -45,7 +45,6 @@ class Main
@app.append template.render(greeting: L.get("greeting", "Verve"))
$content = @app.find("#content")
- console.log "content"
$content.on 'tap', (event) =>
console.log "tap detected"
@dragExample $content

0 comments on commit cfb713c

Please sign in to comment.