Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    static-themepublic

    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)

    Keywords

    none

    install

    npm i static-theme

    Downloadsweekly downloads

    4

    version

    0.0.1

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar