# clone the repo
$ git clone [email protected]:HilalLko/openweathermap.git get-weather
# go into app's directory
$ cd get-weather
# install app's dependencies
$ composer install
# install app's dependencies
$ npm install
Copy file ".env.example", and change its name to ".env". Then in file ".env" complete this database configuration:
- DB_CONNECTION=mysql
- DB_HOST=127.0.0.1
- DB_PORT=3306
- DB_DATABASE=laravel
- DB_USERNAME=root
- DB_PASSWORD=
If your project url looks like: example.com/sub-folder Then go to
get-weather/.env
And modify this line:
- APP_URL =
To make it look like this:
- APP_URL = http://example.com/sub-folder
# in your app directory
# generate laravel APP_KEY
$ php artisan key:generate
# run database migration and seed
$ php artisan migrate:refresh --seed
Add API key and desired language in `.env`
OPENWAETHER_API_KEY=
OPENWAETHER_API_LANG=en
# start local server
$ php artisan serve
# test
$ php vendor/bin/phpunit
{BASE_URL}/api/cities
Sample Output
{BASE_URL}/api/city/weather/current/{city}
Sample Output
{BASE_URL}/api/city/weather/history/{city}
Sample Output
{BASE_URL}/api/city/weather/future/{city}
Sample Output
{BASE_URL}/api/login
Sample Output
{BASE_URL}/api/city/add
Sample Request Header
Sample Output