Skip to content

Instantly share code, notes, and snippets.

@bdarcus
Created February 6, 2011 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdarcus/813579 to your computer and use it in GitHub Desktop.
Save bdarcus/813579 to your computer and use it in GitHub Desktop.
hello world in coffeescript, using express framework for node.js
# Goal:
# $ npm install citenode
# $ citenode start [optional parameters]
# etc.
# Should be completely independent of any particular
# application.
express = require 'express'
fugue = require 'fugue'
citeproc = require 'citeproc'
app = express.createServer()
# here we want to wrap citeproc; not sure how to do this
# or what post methods we want
app.post '/makebib', (req, res) ->
params = req.body
res.send(citeproc.makeBibliography(params))
# let fugue manage the details
fugue.start app, 3000, null, 2, {
verbose: true
}
console.log "CiteProc server listening on port 3000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment