Today, we can find many apps and websites that upload images like photo sharing apps or blog websites. That is why, there are many good reasons to allow users store files on server. Http servers handle file uploading using POST requests. The case is different while talking about node.js. It is hard for node.js alone without using a library to handle uploading. That is the reason, there are many npm packages available. Multer is a good uploading npm package. It is mainly used with express.js.
Building web APIs is easy with Express.JS. I have already posted a tutorial about express.js. Multer is a npm package that handles multipart/form-data. It enables express.js applications to accept files. It is very easy to configure in express.js servers. This blog is minimized to teach only file uploading using multer, however it tries to give you a clue on how to link an image to a record in database and retrieve it later.
#multer #api #nodejs #expressjs #javascript