express-pjax

0.0.1 • Public • Published

express-pjax

Express middleware for Pjax.

Installation

npm install express-pjax

Usage

If you use res.renderPjax method, the request of pjax will be handled automatically.

var express = require('express');
var pjax    = require('express-pjax');
var app     = express.createServer();
 
app.configure(function() {
  app.use(pjax());
  // -- snip --
});
 
app.get('/', function(req, res) {
  res.renderPjax('index', { locals: { hello: "Hello World!" } });
});
 
app.get('/foo', function(req, res) {
  res.renderPjax('foo');
});

TODO

  • Support redirect.

Copyright

Copyright (C) 2011 Dai Akatsuka, released under the MIT License.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    16
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    16

Package Sidebar

Install

npm i express-pjax

Weekly Downloads

16

Version

0.0.1

License

none

Last publish

Collaborators

  • d_akatsuka