This is a ruby on rails app for the Intricately Challanged API.
Docker is required.
-
Clone this repository (you need git installed):
git clone git@github.com:danielscosta/intricately_challenge.git
-
In this repository create and run the containers:
docker-compose up --build app
It will create a postgres container database and ruby container for install the ruby dependencies and start rails server on port 3000.
-
Setup database:
docker-compose run app bundle exec rake db:setup
-
Migrate database:
docker-compose run app bundle exec rails db:migrate
docker-compose run test bundle exec rails db:migrate
-
Get a bash into app container, run:
docker-compose run app bash
-
Tests are stored in the
spec
folder. To run them execute:docker-compose up --build test
-
To add data:
curl -d '{"ip": "127.0.0.1", "hostnames_attributes": ["intricately.com"]}' -H 'Content-Type: application/json' http://localhost:3000/domain_naming_registries
-
To get data:
curl -X GET -d 'page=1&included[]=intricately.com&excluded[]=intricately2.com' http://localhost:3000/domain_naming_registries