This repository contains a Task API implemented in Java using the Spring framework. The API allows for the management of tasks, including creating, updating, deleting, and listing tasks, as well as retrieving details of specific tasks.
- Java
- Spring Boot
- Spring Data JPA
- Database: MongoDB
Before running the API, make sure you have Java and MongoDB installed on your machine.
- Clone this repository to your local machine:
git clone https://github.com/rfsants001/task-api.git
- Navigate to the project directory:
cd task-api
-
Configure the MongoDB database:
- Ensure that MongoDB is installed and running on your local machine.
- Open the
src/main/resources/application.properties
file and adjust the MongoDB connection settings if needed.
-
Run the API:
./mvnw spring-boot:run
The API will be available at http://localhost:8080
.
You can use an HTTP client (e.g., cURL) or a tool like Postman to interact with the API.
Here are some example requests:
-
Create a new task:
POST /tasks Content-Type: application/json { "title": "My first task", "description": "Perform an important task" }
-
List all tasks:
GET /tasks
-
Retrieve details of a specific task:
GET /tasks/{taskId}
-
Update an existing task:
PUT /tasks/{taskId} Content-Type: application/json { "title": "Updated task", "description": "Task updated successfully" }
-
Delete a task:
DELETE /tasks/{taskId}
Contributions are welcome! If you encounter any issues or have suggestions for improvements, feel free to open a new issue or submit a pull request.
This project is licensed under the MIT License.
I hope this helps! If you have any further questions, feel free to ask.