A simple API for managing tasks, developed with PHP, MySQL and Docker. This API allows you to create, read, update, and delete tasks.
Before you begin, ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/k4ik/to-do-api.git cd to-do-api
-
Set up environment variables:
cp .env.example .env
-
Start the application:
docker compose up --build
The API offers the following endpoints:
- Method: GET
- URL:
http://localhost:8080/tasks
- Method: POST
- URL:
http://localhost:8080/tasks
- Body: JSON representing the task structure
- Example:
{ "title": "New task", "completed": 0 }
- Note: Use
0
for false and1
for true .to indicate the completion status of the task.
- Example:
- 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 and1
for true to indicate the completion status of the task.
- Example:
- Method: DELETE
- URL:
http://localhost:8080/tasks/:id
Contributions are welcome! Feel free to submit a pull request or open an issue.