Created
June 2, 2012 11:27
-
-
Save Raynos/2857896 to your computer and use it in GitHub Desktop.
Routil.static
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
var static = require("Routil").Static({ | |
uri: path.join(__dirname, "..", "static") | |
}) | |
static.load("static/**/*.*") | |
module.exports = static |
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
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 |
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
// 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