Skip to content

Instantly share code, notes, and snippets.

@BrianGenisio
Created February 26, 2013 01:29
Show Gist options
  • Save BrianGenisio/5035001 to your computer and use it in GitHub Desktop.
Save BrianGenisio/5035001 to your computer and use it in GitHub Desktop.
port = process.env.PORT || 3001
app = require('express').createServer()
serveUp = (res, filename) ->
console.log "REQUESTING: ", filename
res.sendfile "#{__dirname}#{filename}"
app.get "/", (req, res) -> serveUp res, "/index.html"
app.get "/*", (req, res) -> serveUp res, req.url
app.listen port
console.log "Server started on #{port}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment