- Clone the repo
- Switch ruby version to
ruby-2.6.0
.
rvm install 2.6.0
rvm use 2.6.0
ruby -v
- Edit env variables are per requirements
POSTGRES_HOST=localhost
POSTGRES_DB=todos
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_PORT
will always be set to5432
Note: development
, test
and production
environments use the same db. In case you need different db's, feel free to edit config/database.yml
rake db:setup
rails s
Server should be running on port 3000
by default.
POST /todo_items
with req body
{
name: "Read a book",
completed: false
}
Note: completed
is optional(false
by default)
INDEX - GET /todo_items
gives a list of all todos.
or
SHOW - GET /todo_items/:id
gives a has of single todo item
PUT /todo_items/:id
with req body
{
name: "Water plants",
completed: true
}
DELETE /todo_items/:id