Question: Your web service needs to be implemented using the node.js framework. Your web server should use SQLite to connect to a (given) product database, and

Your web service needs to be implemented using the node.js framework. Your web server should use SQLite to connect to a (given) product database, and then allow this database to be manipulated by handling incoming HTTP requests appropriately.

Your web service needs to provide web clients with the following functionality:

  1. to retrieve the full data set (all rows currently stored in your local product inventory database);

    In addition, it should provide the so-called minimal CRUD (Create, Retrieve, Update and Delete) interface on single rows. That is, it should be possible:

  2. to add data for a new product item (Create),
  3. to list the data of a specific item (Retrieve),
  4. to change data of a specific item (Update), and
  5. to remove data of a specific item (Delete);

To realize this functionality, your web service has to allow web developers to manipulate the data in the product inventory over a RESTful HTTP 1.1 API. To be truly RESTful, it needs to meet the following requirements:

  1. The API uses the most appropriate HTTP 1.1 method for each function it provides.
  2. Every HTTP GET method should be guaranteed safe;
  3. except for POST, all other HTTP methods should be idempotent;
  4. in all HTTP responses, the response body is served in the format that is currently most popular under web developers: JSON. Your service should also accept JSON data as input (i.e. to create or update an item), this data should be sent in the request body (and not in the URL query parameters);
  5. all responses deploy the most appropriate HTTP header(s) (including one indicating the appropriate MIME type of the data returned - this should be taken care of by express for you, but check in the response headers this is indeed the case);
  6. all responses deploy the most appropriate HTTP response codes, not only on successful, but also on failed requests.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!