Skip to content

Instantly share code, notes, and snippets.

@debrouwere
Created October 25, 2011 21:20
Show Gist options
  • Save debrouwere/1314323 to your computer and use it in GitHub Desktop.
Save debrouwere/1314323 to your computer and use it in GitHub Desktop.
A full working example of a filetype handler in the draughtsman server.
stylus = require 'stylus'
module.exports = (app) ->
app.get /^(.*\.styl)$/, (req, res) ->
stylus(req.file.content).render (err, css) ->
if err
res.send err
else
res.contentType 'text/css'
res.send css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment