Created
March 3, 2014 20:12
-
-
Save zdne/9333604 to your computer and use it in GitHub Desktop.
Trivial express.js app in CoffeeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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