Skip to content

Instantly share code, notes, and snippets.

@zdne
Created March 3, 2014 20:12
Show Gist options
  • Save zdne/9333604 to your computer and use it in GitHub Desktop.
Save zdne/9333604 to your computer and use it in GitHub Desktop.
Trivial express.js app in CoffeeScript
express = require 'express'
app = express()
PORT = 1234
app.get '/machines', (req, res) ->
res.setHeader 'Content-Type', 'application/json'
machine =
type: 'bulldozer'
name: 'willy'
response = [machine]
res.send 203, response
server = app.listen PORT, () ->
console.log "server up on http://localhost:#{PORT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment