static-theme

0.0.1 • Public • Published

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

Author: [Simyung Kim(http://simyungk.blogspot.com)

Dependencies (1)

Dev Dependencies (2)

Package Sidebar

Install

npm i static-theme

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • simyungk