Skip to content

Antarian/a-v-rillo

Repository files navigation

Info

Example took me about 5-6 hours. As I am not used to Laravel and was looking for options to avoid Facades and other static/magic stuff anywhere else apart from config. There was high possibility that two or more quotes will be same in group of five. As external API is called 5 times. This is avoided by using while loop.

As while loop can run up to memory full or time limit of script if no original item is found, there is a counter to prevent this and throw exception. This behaviour can be altered to lessen on increase tries or to return whatever quotes we have.

Manual refresh endpoint is OK for less heavy API. But with most APIs I would rather go with combination of Last-Modified/If-Modified-Since Or at least inform client with Cache-Control header and refresh data in specific times.

Installation

Instructions are for Ubuntu and may not be correct for Windows/Mac, check Sail docs for those systems in case of any problems running the server.

  1. Run composer
composer install
  1. Build and run Laravel Sail
./vendor/bin/sail build
./vendor/bin/sail up -d

3.Add .env file by copying .env.example file.

  1. Populate APP_KEY:
./vendor/bin/sail artisan key:generate

And also API_KEY and KAYNE_WEST_URL keys.

  1. Run tests
./vendor/bin/sail artisan test
  1. Check browser

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published