Skip to content

k4ik/to-do-api

Repository files navigation

To Do API

A simple API for managing tasks, developed with PHP, MySQL and Docker. This API allows you to create, read, update, and delete tasks.

Prerequisites

Before you begin, ensure you have the following installed:

Installation

  1. Clone the repository:

    git clone https://github.com/k4ik/to-do-api.git
    cd to-do-api
  2. Set up environment variables:

     cp .env.example .env
  3. Start the application:

    docker compose up --build

Endpoints

The API offers the following endpoints:

1. List Tasks

  • Method: GET
  • URL: http://localhost:8080/tasks

2. Create Task

  • Method: POST
  • URL: http://localhost:8080/tasks
  • Body: JSON representing the task structure
    • Example:
      {
        "title": "New task",
        "completed": 0
      }
    • Note: Use 0 for false and 1 for true .to indicate the completion status of the task.

3. Update Task

  • Method: PUT
  • URL: http://localhost:8080/tasks/:id
  • Body: JSON representing the task structure
    • Example:
      {
        "title": "Updated task",
        "completed": 1
      }
    • Note: Use 0 for false and 1 for true to indicate the completion status of the task.

4. Delete Task

  • Method: DELETE
  • URL: http://localhost:8080/tasks/:id

Contribution

Contributions are welcome! Feel free to submit a pull request or open an issue.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published