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 https://127.0.0.1:3000
_todos_session
The session must included in the header of every requests.
GET '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 '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 '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 '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 '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}]