/growin-assessment-geolite-country

Growin Assessment GeoLite Country IP

Primary LanguagePHP

Technical Task | Nearshore Growin

Simple project showing how to load GeoLite Country IP list from CSV file into a Restful API database and match IP and Country respectively throught GET endpoint, also make automated tests.


How to use

  • Clone the repository with git clone
  • Create a DB called 'geolite'
  • Copy .env.example file to .env and edit database credentials there
  • Run composer install
  • Run php artisan key:generate
  • Run php artisan migrate
  • Run php artisan db:seed to Load CSV file and fill table countries
  • Run php artisan serve to Run Built-in web server
  • That's it - Try api GET endpoint on localhost:8000/api/locationByIP?IP=127.0.0.1 (Change for the IP you want to)

License

Please use and re-use however you want.