connect-jade-static

Connect (expressjs) middleware for serving html files from jade template

npm install connect-jade-static
4 downloads in the last day
12 downloads in the last week
294 downloads in the last month

connect-jade-static Build Status

Connect (ExpressJS) middleware for serving jade files as static html

Installation

npm install connect-jade-static

Usage

Assume the following structure of your project:

/views
  /partials
    /file.jade

Let's make jade files from /views/partials web accessable:

var jadeStatic = require('connect-jade-static');

app = express();
app.configure(function() {
  app.use(jadeStatic({
    baseDir: path.join(__dirname, '/views/partials'),
    baseUrl: '/partials',
    jade: { pretty: true }
  }));
});

Now, if you start your web server and request /views/partials/file.html in browser you should be able see the compiled jade template.


by http://adslot.com

npm loves you