Skip to content

Instantly share code, notes, and snippets.

@PastorBones
PastorBones / app.js
Created November 18, 2011 08:11
Add stylesheets to Express layout dynamically
var express = require('express')
, app = express.createServer()
// Function to push formatted style
// paths onto our stylesheet variable
var addStyles = function(res, styles) {
styles.forEach(function(style){
res.app.settings['view options'].styles.push('/stylesheets/' + style + '.css')
})
return true