Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created June 2, 2012 11:27
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 Raynos/2857896 to your computer and use it in GitHub Desktop.
Save Raynos/2857896 to your computer and use it in GitHub Desktop.
Routil.static
var static = require("Routil").Static({
uri: path.join(__dirname, "..", "static")
})
static.load("static/**/*.*")
module.exports = static
var stylus = require("stylus"),
nib = require("nib")
var static = require("Routil").Static({
uri: path.join(__dirname, "..", "stylus"),
mapUri: function (uri) {
return uri.replace(/\.css/, '.styl')
},
render: function (raw, callback) {
stylus(raw.toString())
.use(nib())
.render(function (err, css) {
callback(err, css && new Buffer(css))
})
},
defaultType: "text/css"
})
static.load("stylus/**/*.styl")
module.exports = static
// See Routil on github
// https://github.com/Raynos/routil/blob/87233fc8345c0b11e0ea9fdea1baa0e72729f757/lib/static.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment