page-body-parser

1.0.0 • Public • Published

Pagejs BodyParser Plugin (module)

This plugin adds the body-parser api to the page.js router and enables you to handle form submit events as you would normally handle the events on the server:

Example Usage

<form action="/foo/bar" method="POST">
  <input type="text" name="beep" />
  <input type="submit" value="Submit" />
</form>
<script src="bundle.js"></script>
var page = require('page');
// require page-body-parser
var pageBodyParser = require('page-body-parser');

page('/foo/bar', function(ctx) {
  console.log(ctx.body);
});

page();
// initialize after page init
pageBodyParser();

Installatiion

npm install page-body-parser

Thanks to

Eric Newport kethinov

This is a fork of https://github.com/kethinov/page.js-body-parser.js for focused usage with browserify.

Tj visionmedia

For page.js the micro side client router inspired by expressjs

Readme

Keywords

none

Package Sidebar

Install

npm i page-body-parser

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • twilson63