Skip to content

varishasiddiqui/CRUD_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Task API

A simple CRUD API built with FastAPI that allows users to create, read, update, and delete tasks. Data is stored in memory, so it resets whenever the server restarts.

Installation & Run

  1. Clone the repository:
git clone https://github.com/varishasiddiqui/CRUD_API.git
cd CRUD_API
  1. Create and activate a virtual environment:
python -m venv venv

Windows:

venv\Scripts\activate
  1. Install dependencies:
pip install fastapi uvicorn
  1. Run the server:
uvicorn main:app --reload

Open:


API Endpoints

Method Endpoint Description
GET / API information
GET /health Health check
GET /tasks Get all tasks
GET /tasks/{id} Get task by ID
POST /tasks Create a new task
PUT /tasks/{id} Update a task
DELETE /tasks/{id} Delete a task

Example

Request:

curl -i http://127.0.0.1:8000/tasks

Response:

HTTP/1.1 200 OK

[
  {
    "id": 1,
    "title": "Buy groceries",
    "done": false
  }
]

Note

This project stores data in memory only. Any tasks created will be lost when the server is restarted.

About

FlyRank Internship - W2 A1

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages