It's REST API which locates and stores location basing on IP or URL.
Rubocop
$ git clone https://github.com/KacperMekarski/geolocator.git
$ cd geolocator
Download master.key file and place it in config directory. File was given in email with link to this repo)
$ docker compose build
$ docker compose run web rake db:setup
$ docker compose up
You can run tests with:
$ docker compose run web bundle exec rspec spec
Stop application with:
$ docker compose down
Sorry for such documentation, I know it should be done with swagger or something but I didn't have time for it.
Provide geolocation data based on IP address:
GET /api/ip_addresses/20.199.210.196
Delete geolocation data based on IP address:
DELETE /api/ip_addresses/20.199.210.196
Add geolocation data based on IP address:
POST /api/ip_addresses, body: { 'ip': '20.199.210.196' }
Please note URL should be encoded.
Provide geolocation data based on URL address:
GET /api/domains?url=https://google.com
Delete geolocation data based on URL address:
DELETE /api/domains?url=https://google.com
Add geolocation data based on URL address:
POST /api/domains, body: { 'url': 'https://google.com' }
MIT © Kacper Mękarski