Giter Site home page Giter Site logo

todoapps's Introduction

ToDoList API

"This was created during my time as a student at Code Chrysalis."
This offers API of ToDoList and includes HTML which is Example of use.

Setup

Install dependencies.
yarn
Start service.
yarn start
If you need seed data, use this command.
yarn run knex --knexfile models/knexfile.js seed:run
Check
http://localhost:3000/todos/

API

POST /api/todos

Create todo.

request params

{
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
}

response (created todo item)

{
  id: 93,
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
  updated_at: 2020-01-26T01:03:20.000Z
}

GET /api/todos

Return todo list.

response (list of todo item)

[{
  id: 93,
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
  updated_at: 2020-01-26T01:03:20.000Z
},
{....}
]

GET /api/todos/:id

Return the todo-item with the given id.

response

{
  id: 93,
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
  updated_at: 2020-01-26T01:03:20.000Z
}

PATCH /api/todos/:id

Update todo-item

request params

{
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
}

response (updated todo item)

{
  id: 93,
  title: 'newtitle3',
  description: 'newtitle888',
  priority: 'low',
  due_date: 2020-12-30T02:11:12.000Z,
  updated_at: 2020-01-26T01:03:20.000Z
}

DELETE /api/todos/:id

Delete todo-item

response (result of operation)

"OK"

DB

DB name: todoapp
TABLE name: todos
Table schema:

id :int(unique)
title :string
description :text
priority :enum (low, middle, high)
dueDate :date
updatedAt :date

todoapps's People

Contributors

dependabot[bot] avatar harunamarun avatar

Watchers

 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.