In this post I am not going to explain, what is REST? I assume you are already aware of REST concepts hence on this post to create REST API on Node.js which will perform CRUD operations. I am going to use Visual Studio to create Node Application.
First we are going to create data and CRUD operation on that. Keep in mind that we are going to expose CRUD operation as REST API on a JavaScript Array. In real projects you may want to perform these operations on database.
Let us start with writing function to return products. If you notice function is taking two parameters req and res. We send data in HTTP response with res.send . In this case we are sending JSON object product as HTTP response...