Project 1: Building a simple kittens API
- Clone this repository to your local machine.
git clone git@github.com:helmihidzir/odin-kittens.git
- Change into the
odin-kittens
directory.
cd odin-kittens
- Install the project dependencies using bundler.
gem install bundler
bundle install
- Create the database.
rails db:create
- Run the database migrations.
rails db:migrate
- Start the Rails server.
rails s
- Lastly, navigate to http://localhost:3000/ to play around with the project.
- Install rest-client gem and go to the irb:
require 'rest-client'
- To GET all kittens:
response = RestClient.get("http://localhost:3000/kittens")
- To POST or create new kitten:
response = RestClient.post('http://localhost:3000/kittens', kitten: {name: 'neko', age: 12, cuteness: 5, softness: 5})