node

Super easy image uploads with Multer and Express

Multer makes file uploads via <form enctype="multipart/form-data"></form> really simple. If you're looking to host user images on your filesystem and are wondering about the best practices involved, here's what works for me. 1. The form For the purposes of the article, I'm going…

Two really cool Node MySQL tips

Node MySQL is a great traditional alternative to mongo and all the jazz youngins are using. One important advice - never use + to concatenate queries unless you know what you're doing. 1. Always escape using ? as placeholders Queries are usually written as: connection.query('SELECT * FROM foo WHERE bar = baz',…