Todolist App for Ruby on Rails
- Git
- Ruby
- Rails
git clone https://github.com/mdluo/todos.git
cd todos
bundle install
rake db:migrate
rails server
Done! Go to http:https://127.0.0.1:3000
_todos_session
The session must included in the header of every requests.
GET 'http:https://host/todos/all'
Response JSON data sample:
[{"id":1,"task":"Task Title 01","completed":true},{"id":2,"task":"Task Title 2","completed":false}]
POST 'http:https://host/todos/create'
New todo request JSON data sample:
{"task":"New Todo Title"}
New todo response JSON data sample:
{"id":1,"task":"New Todo Title","completed":false}
POST 'http:https://host/todos/update'
Update todo request JSON data sample:
{"id":1}
Update todo response JSON data sample:
{"id":1,"task":"New Todo Title","completed":true}
POST 'http:https://host/todos/delete'
Delete todo request JSON data sample:
{"id":1}
Delete todo response JSON data sample:
{"id":1,"task":"New Todo Title","completed":true}
POST 'http:https://host/todos/delete'
Request JSON data:
{"id":-1}
Response JSON data sample (Return todos have not been marked as completed):
[{"id":1,"task":"Task Title 01","completed":false},{"id":2,"task":"Task Title 2","completed":false}]