RESTful API with CRUD operations

Medium
0.0% Acceptance

In this lab, you will build a RESTful API using Node.js and Express.js to manage a list of tasks. The tasks will be stored in-memory and will not require any database connections. Each task will contain an id, a name, and a boolean flag to indicate whether it is completed or not.

You'll be implementing the following API endpoints:

  1. GET /tasks - Get all tasks
  2. POST /tasks - Add a new task to the list
  3. PUT /tasks/:id - Update a task by its id
  4. DELETE /tasks/:id - Remove a task by its id

For this lab, you will be primarily working with the app.js file where the main Express.js setup and route handling will be done. You should separate various CRUD operations to different middleware to handle the functionality of each API endpoint. Ensure that proper error handling is done and all requirements are met for each API call.