Code Monkey home page Code Monkey logo

task-storage's Introduction

Task Storage API

RESTful API for a task storage

Java 11
MySQL 8
Gradle
Spring Boot
Spring Data JPA
Flyway
Docker

  • GET http request that returns a list of all tasks stored in the database.
  • GET http request that returns a specific task by their ID.
  • POST http request that stores a new task in the database.
  • PUT http request that updates a specific task by their ID.
  • DELETE http request that deletes a task in the database.

The API utilizes standard HTTP status codes (400 range for client errors, 500 range for server-side)
Example usages of endpoints

GET /api/tasks
GET /api/tasks?completed=true
GET /api/tasks?priority=high

Example Response

[
   {
      "id":1,
      "description":"d3",
      "completed":true,
      "priority":"HIGH",
      "created":"2024-02-25T14:14:00Z"
   }
]

GET /api/tasks/1

Example Response

{
   "id":1,
   "description":"d3",
   "completed":true,
   "priority":"HIGH",
   "created":"2024-02-25T14:14:00Z"
}

POST /api/tasks/

Example Request

{
   "description":"d2",
   "priority":"LOW"
}

PUT /api/tasks/1

Example Request

{
   "description":"d3",
   "priority":"HIGH",
   "completed":true
}

DELETE /api/tasks/1

CURL request examples
curl http://localhost:8080/api/tasks
curl -G -d "completed=false" -d "priority=HIGH" http://localhost:8080/api/tasks
curl -X PUT -H "Content-Type: application/json" -d '{"description": "d3", "priority": "HIGH", "completed": true}' http://localhost:8080/api/tasks/1
curl -X POST -H "Content-Type: application/json" -d '{"description": "d2", "priority": "LOW"}' http://localhost:8080/api/tasks/
curl http://localhost:8080/api/tasks/3

task-storage's People

Contributors

faic avatar mkharuk-ratedpower avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.