Showing posts with label webdev. Show all posts
Showing posts with label webdev. Show all posts

Thursday, October 30, 2014

Node.js "Error: too many parameters at queryparse"

If you've been using Express' body-parser and attempting to process large data submissions (aka forms with more than 1000 elements or 1000 sub-elements, you may have run into the following error:

Error: too many parameters
    at queryparse (/project/node_modules/body-parser/lib/types/urlencoded.js:120:17)
    at parse (/project/node_modules/body-parser/lib/types/urlencoded.js:64:9)

This is due to the fact the urlencode defaults to 1000 parameters by default. If you have a large form or just an abnormally large JSON submission, you'll need to increase this limit by doing the following:

var bodyParser = require('body-parser');

app.use(bodyParser.urlencoded({
        extended: false,
    parameterLimit: 10000,
    limit: 1024 * 1024 * 10
}));
app.use(bodyParser.json({
        extended: false,
    parameterLimit: 10000,
    limit: 1024 * 1024 * 10
}));


This will allow you to provide up to 10,000 parameters (increase as needed) and 10 MB of data (also adjustable).

Sunday, May 11, 2014

Cast Reddit to Your Chromecast

I just finished up a weekend project called "Castddit.com." The premise is to be able to replace any Reddit URL with "castddit" and have the images from that subreddit sent to your Chromecast in an image-slideshow fashion.

I have released a beta version at: http://castddit.com.

Some of the best subreddits for this platform include the safe-for-work pron networks. You can see some demos here:


It also works well on /r/pics and /r/funny.

If you're interested in how I made the site, check out my Chromecast tutorials, which I wrote while making this site.

Feel free to critique the site and let me know what you think!