with?
I get this error ...
connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead node_modules/connect/lib/middleware/bodyParser.js:56:20 connect deprecated limit: Restrict request size at location of read node_modules/connect/lib/middleware/multipart.js:86:15
when I'm working on this tutorial here:
https://code.tutsplus.com/tutorials/introduction-to-express--net-33367
and the comments say not to use this. And of course the error goes away when I remove this statement
Once again the bad code is here:
app.use(express.bodyParser());
The full code is here:
var express = require('express');
var hbs = require('hbs');
var path = require('path');
var blogEngine = require('./blog');
var app = express();
var path_index = '../web_arcmarks/packet.html';
var path_index_resolved = path.resolve(path_index);
app.set('view engine', 'html');
app.engine('html', hbs.__express);
app.use(express.bodyParser());
app.use(express.static('public'));
// add templates
app.get('/', function(req, res) {
res.render('index',{title:"My Blog", entries:blogEngine.getBlogEntries()});
});
app.get('/about', function(req, res) {
res.render('about', {title:"About Me"});
});
app.get('/article/:id', function(req, res) {
var entry = blogEngine.getBlogEntry(req.params.id);
res.render('article',{title:entry.title, blog:entry});
});
app.listen(3000);
blog.js looks like this:
var entries = [
{"id":1, "title":"Hello World!", "body":"This is the body of my blog entry. Sooo exciting.", "published":"6/2/2013"},
{"id":2, "title":"Eggs for Breakfast", "body":"Today I had eggs for breakfast. Sooo exciting.", "published":"6/3/2013"},
{"id":3, "title":"Beer is Good", "body":"News Flash! Beer is awesome!", "published":"6/4/2013"},
{"id":4, "title":"Mean People Suck", "body":"People who are mean aren't nice or fun to hang around.", "published":"6/5/2013"},
{"id":5, "title":"I'm Leaving Technology X and You Care", "body":"Let me write some link bait about why I'm not using a particular technology anymore.", "published":"6/10/2013"},
{"id":6, "title":"Help My Kickstarter", "body":"I want a new XBox One. Please fund my Kickstarter.", "published":"6/12/2013"}];
exports.getBlogEntries = function() {
return entries;
};
exports.getBlogEntry = function(id) {
for(var i=0; i < entries.length; i++) {
if(entries[i].id == id) return entries[i];
}
};