A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/kethinov/page.js-body-parser.js below:

kethinov/page.js-body-parser.js: 📄 [DEPRECATED] Plugin for page.js which implements support for forms akin to body-parser.

This project is no longer maintained. It also does not work with the latest version of page.js. See single-page-express for a spiritual successor.

A plugin for page.js which extends it to handle forms as well.

Form data is populated in the req object provided by page.js in a manner similar to how body-parser populates the req object provided by Express.

page('/some_form_action', function(req) {

  // the form data is in the object req.body
  console.log(req.body);
});

Either download the file from here or use bower:

bower install page.js-body-parser.js

Load page.js-body-parser.js after loading page.js.

Then initialize it by calling:

Check out sampleApp.html for simple demonstration of how this works.

To run it, follow these steps:

Clone this repo:

git clone https://github.com/kethinov/page.js-body-parser.js.git

Install page.js:

cd page.js-body-parser.js
bower install page.js

Start a simple web server (example assumes you have python installed, but you could use any web server):

python -m SimpleHTTPServer

Then open http://localhost:8000/sampleApp.html in your browser.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4