Last active
September 23, 2016 10:20
-
-
Save mk-pmb/6ffd658e6b1eb8d8ab78f1adae2be5be to your computer and use it in GitHub Desktop.
meese's LED request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var jquery = require('jquery'); | |
-var bodyParser = require('body-parser'); | |
+var collectStream = require('collect-stream'); | |
var app = express(); | |
-app.use(bodyParser.json()); // for parsing application/json | |
-app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded | |
+ | |
+function receiveLedMatrix(req, res, err, body) { | |
+ console.log({ 'error?': err, swtiches: body }); | |
+} | |
+ | |
app.post('/ledsubmit', function(req, res) { | |
- var data = req.body; | |
- console.log(data); | |
+ collectStream(req, receiveLedMatrix.bind(null, req, res)); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /ledsubmit HTTP/1.1 | |
Host: 45.55.213.88:1337 | |
User-Agent: … | |
Accept: */* | |
Accept-Language: en-US,en;q=0.5 | |
Accept-Encoding: gzip, deflate | |
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 | |
Referer: http://45.55.213.88/ledart/ | |
Content-Length: 64 | |
Origin: http://45.55.213.88 | |
Connection: keep-alive | |
0000000000000000000000000000000000000000000000000000000000000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment