0.2.2 • Published 10 years ago

connect-jade-static v0.2.2

Weekly downloads
45
License
MIT
Repository
github
Last release
10 years ago

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:

Express prior to 4.0

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

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

Express 4.0

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

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

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


by http://adslot.com

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago