A REST API that performs CRUD operations (Create(POST), Read(GET), Update(PUT), Delete(DELETE)) on a "person" resource. The API dynamically handles parameters, such as adding or retrieving or updating a person by ID or name. Data and information about different persons is stored in a MongoDB database.
- Create a new task record with details such as task name, and completion status which is normally in a default state of false.
- Retrieve all tasks in database
- Retrieves details of a specific task.
- Update the details of a specific task.
- Delete a task from the database.
Before you begin, ensure you have the following:
- Node.js installed on your machine.
- A database system must be set up and running. For this API we are implementing MongoDB
-
Cloning the repository:
git clone https://github.com/Nonso024/taskmanagerapi
-
Change to the project directory:
cd taskmanagerapi -
Install the required dependencies:
npm install
-
Kicstart the server:
npm start OR nodemon app.js
-
GET (/api/v1/tasks) : Retrieve all the tasks stored in the database.
-
GET (/api/v1/tasks/:id) : Retrieve details of a specific task by id.
-
POST /api/v1/tasks: Creates a new task record.
-
PATCH (/api/v1/tasks/:id) : Update the details of a specific task with the id parameter.
-
DELETE (/api/v1/tasks/:id): Delete a task record.
To retrieve a list of all the tasks stored in the database, make a GET request to the following endpoint:
GET /api/v1/tasksTo retrieve details of a specific task, a GET request would be made to the following endpoint with the id parameter:
GET /api/v1/tasks/:idTo create a new task record, a POST request is submitted through the following endpoint:
POST /api/v1/tasksTo update an existing person task record, make a PUT request to the following endpoint.
PATCH /api/v1/tasks/:idTo delete a task, a DELETE request is made to the following endpoint:
DELETE /api/v1/tasks/:id