Microservice for ads management.
- Ruby 3.1.0
- PostgreSQL 9.6+
- Create databases
psql >
CREATE DATABASE micro_ads_development;
CREATE DATABASE micro_ads_test;
- Install app dependencies
bundle install
- Run DB migrations
bundle exec rake db:migrate
bundle exec rackup apps/http/config.ru
The app is running at http://localhost:9292
GET http://localhost:9292?page=1&per_page=10
POST http://localhost:9292/ads
Params (required):
{
user_id: 1,
title: 'Kittens in good hands',
city: 'Erevan',
description: 'Sweet, furry =^.^='
}
PATCH http://localhost:9292/ads/:id
Params (required):
{
coordinates: {
latitude: 55.7540471,
longitude: 37.620405
}
}
bundle exec rspec