Skip to content

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.

License

Notifications You must be signed in to change notification settings

Asrez/php-todo-list-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP To-Do List API

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.

Features

  • Create a new to-do item
  • Get a list of all to-do items
  • Update a specific to-do item
  • Delete a specific to-do item

Requirements

  • PHP 8.3
  • MySQL or any other database
  • Web server (Apache/Nginx)

Installation

Clone the repository:

git clone https://github.com/Asrez/php-todo-list-api.git

Navigate to the project directory:

cd php-todo-list-api

Configure the database connection by updating the database settings in config.php.

Import the todo_list.sql file into your database to set up the table structure.

API Endpoints

  1. List All Tasks

URL: /tasks

Method: GET

Response: List of all tasks in JSON format.

  1. Get a Single Task

URL: /task/{id}

Method: GET

Response: JSON object of the task with the specified id.

  1. Create a Task

URL: /task

Method: POST

Parameters:

  • title: (string) Task title.
  • description: (string) Task description.
  • Response: JSON object of the created task.
  1. Update a Task

URL: /task/{id}

Method: PUT

Parameters:

  • title: (string) Task title.
  • description: (string) Task description.

Response: JSON object of the updated task.

  1. Delete a Task

URL: /task/{id}

Method: DELETE

Response: Success message in JSON format.

Copyright 2024, asrez team

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages