- bundle install
SQLite3 is used for simplicity
-
copy database config
cp config/database.yml.sample config/database.yml
-
Prepare database
rake db:create && rake db:migrate
-
Seed data
rake db:seed
, available country codes:uk, de, pl
-
run rails server
rails s
##Public /api/v1/public/
http://localhost:3000/api/v1/public/locations/:country_code
http://localhost:3000/api/v1/public/target_groups/:country_code
too-many-secrets
http://localhost:3000/api/v1/private/locations/pl?token=too-many-secrets
http://localhost:3000/api/v1/private/target_groups/pl?token=too-many-secrets
Any private endpoint call without token causes Unauthorized
error (code 401)
POST http://localhost:3000/api/v1/private/evaluate_target/?token=too-many-secrets
{
"country_code": "uk",
"target_group_id": 1,
"locations": [
{
"id":123,
"panel_size": 200
}
]
}
{
"price": 56
}