Skip to content

jakarea/express-react-mysql-crud

 
 

Repository files navigation

express-react-mysql-crud

This a task management demo project to crud using react, express and mysql.

Here are some API endpoint for backend

Get task list GET http://localhost:4000/api/tasks

Respose

{
    "type": "ok",
    "status": 200,
    "total": 18,
    "pagination": {
        "per_page": 10,
        "current_page": 1,
        "last_page": 2,
        "first_page_url": "http://localhost:4000/api/tasks?page=1",
        "last_page_url": "http://localhost:4000/api/tasks?page=2",
        "next_page_url": "http://localhost:4000/api/tasks?page=2",
        "prev_page_url": null,
        "path": "http://localhost:4000/api/tasks",
        "from": 1,
        "to": 10
    },
    "task": [
        {
            "id": 5,
            "title": "This is a task 3 for you",
            "description": "This is task 3 descriptions",
            "type": "task type",
            "status": "Active",
            "due_date": "2020-10-10",
            "createdAt": "2020-06-01T18:24:42.000Z",
            "updatedAt": "2020-06-01T18:24:42.000Z"
        },
        {....}
   ]
}

Get single task GET http://localhost:4000/api/tasks/:id

Response

{
    "type": "ok",
    "status": 200,
    "task": {
        "id": 5,
        "title": "This is a task 3 for you",
        "description": "This is task 3 descriptions",
        "type": "task type",
        "status": "Active",
        "due_date": "2020-10-10",
        "createdAt": "2020-06-01T18:24:42.000Z",
        "updatedAt": "2020-06-01T18:24:42.000Z"
    }
}

** Update task ** PUT http://localhost:4000/api/tasks/:id

Response

{
    "type": "ok",
    "status": 201,
    "message": "Task updated.",
    "updated": 1,
    "task": {
        "id": 5,
        "title": "This title has updated!",
        "description": "This is task 3 descriptions",
        "type": "task type",
        "status": "Active",
        "due_date": "2020-10-10",
        "createdAt": "2020-06-01T18:24:42.000Z",
        "updatedAt": "2020-06-03T17:33:50.000Z"
    }
}

Delete task DELETE http://localhost:4000/api/tasks/:id

Response

{
    "type": "ok",
    "status": 200,
    "deleted": 1
}

About

This a task management demo project to crud using react, express and mysql.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy