static-theme
A static theme middleware for node.js.
Installation
npm install static-theme
Usage
var staticTheme = require('static-theme');
/*
* - `defaultTheme` Default theme name
* - `themeProp` Theme session property name. ex) req.session.theme
* - `publicPath` Relative public path from theme dir.
* - `maxAge` Browser cache maxAge in milliseconds. defaults to 0
* - `hidden` Allow transfer of hidden files. defaults to false
* - `redirect` Redirect to trailing "/" when the pathname is a dir
*/
var options = {
defaultTheme:'default'
, themeProp:'theme'
, publicPath:'public'
, maxAge:86400000
};
app.use(staticTheme(__dirname+'/themes', options));
Run Tests
npm test