Created
October 25, 2011 21:20
-
-
Save debrouwere/1314323 to your computer and use it in GitHub Desktop.
A full working example of a filetype handler in the draughtsman server.
This file contains 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
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