Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pbastowski/body-parser
Adds a POST body-parser middleware to Meteor's internal WebApp server
https://github.com/pbastowski/body-parser
Last synced: 4 days ago
JSON representation
Adds a POST body-parser middleware to Meteor's internal WebApp server
- Host: GitHub
- URL: https://github.com/pbastowski/body-parser
- Owner: pbastowski
- Created: 2015-06-11T08:10:10.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-02T13:11:33.000Z (about 8 years ago)
- Last Synced: 2023-08-12T08:13:03.841Z (over 1 year ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Add a POST body-parser middleware to the internal WebApp server
Sometimes you might want to accept url-encoded form POST requests on your Meteor WebApp server, without using Iron Router, such as in the code below:
```javascript
var Fiber = Npm.require('fibers');WebApp.connectHandlers
.use('/mail', function (req, res) {
var that = this;
Fiber(function () {var body = req.body;
...
}).run();
});
```This unfortunately does not work out of the box, because there is no body-parser middleware included in the standard Meteor WebApp configuration.
#### How do you make it work?
Install the `pbastowski:body-parser` package and the above example will work as shown.
### Install:
meteor add pbastowski:body-parser