Skip to content

Commit 6b65963

Browse files
authored
Update README.md
1 parent 64db400 commit 6b65963

File tree

1 file changed

+85
-1
lines changed

1 file changed

+85
-1
lines changed

README.md

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,85 @@
1-
# php-todo-list-api
1+
# PHP To-Do List API
2+
3+
This project is a simple RESTful API for managing a to-do list. It is built using pure PHP and follows basic API development principles. The API provides functionality to create, read, update, and delete tasks.
4+
5+
## Features
6+
7+
- Create a new to-do item
8+
- Get a list of all to-do items
9+
- Update a specific to-do item
10+
- Delete a specific to-do item
11+
12+
## Requirements
13+
14+
- PHP 8.3
15+
- MySQL or any other database
16+
- Web server (Apache/Nginx)
17+
18+
## Installation
19+
20+
Clone the repository:
21+
22+
```bash
23+
git clone https://github.com/Asrez/php-todo-list-api.git
24+
```
25+
26+
Navigate to the project directory:
27+
28+
```bash
29+
cd php-todo-list-api
30+
```
31+
32+
Configure the database connection by updating the database settings in config.php.
33+
34+
Import the `todo_list.sql` file into your database to set up the table structure.
35+
36+
## API Endpoints
37+
38+
1. List All Tasks
39+
40+
URL: /tasks
41+
42+
Method: GET
43+
44+
Response: List of all tasks in JSON format.
45+
46+
2. Get a Single Task
47+
48+
URL: /task/{id}
49+
50+
Method: GET
51+
52+
Response: JSON object of the task with the specified id.
53+
54+
3. Create a Task
55+
56+
URL: /task
57+
58+
Method: POST
59+
60+
Parameters:
61+
- title: (string) Task title.
62+
- description: (string) Task description.
63+
- Response: JSON object of the created task.
64+
65+
4. Update a Task
66+
67+
URL: /task/{id}
68+
69+
Method: PUT
70+
71+
Parameters:
72+
- title: (string) Task title.
73+
- description: (string) Task description.
74+
75+
Response: JSON object of the updated task.
76+
77+
5. Delete a Task
78+
79+
URL: /task/{id}
80+
81+
Method: DELETE
82+
83+
Response: Success message in JSON format.
84+
85+
Copyright 2024, asrez team

0 commit comments

Comments
 (0)