Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Latest commit

 

History

History
60 lines (34 loc) · 1017 Bytes

README.md

File metadata and controls

60 lines (34 loc) · 1017 Bytes

simple single-user Slim todo app

example definition of REST webservice to create/read/update/delete/ tasks

  • it uses Slim as php Framework

install

Create a database, and import initial SQL definition file resources/todo-app.sql. Tune your settings src/settings.php

Download dependencies ( need composer )

composer install

run

composer start

available API

  • get all todos:
curl http://localhost:8080/api/v1/todos
  • get todo with id=6:
curl http://localhost:8080/api/v1/todos/6
  • update todo with id=6:
curl -XPUT -d '{"task":"my task", "priority":1}' http://localhost:8080/api/v1/todos/6
  • delete todo with id=6:
curl -XDELETE  http://localhost:8080/api/v1/todos/6
  • create todo:
curl -XPOST -d '{"task":"my task", "priority":1}' http://localhost:8080/api/v1/todos

Sample mini-js app available at http://localhost:8080/todos_object.html