Weather - PHP
This application is a weather data api write in PHP.
Works with drivers, native support to OpenWeather.
Motivation
Have a fully functional PHP application to use as an example in the articles: PHP+NGINX with Docker in production.
Installation
-
Clone the repository
git clone git@github.com:fontebasso/weather-php.git
-
Access base code directory of the project and install dependencies
cd weather-php/src composer install
-
Create the .env file and change the values of the environment variables as per your case
cp .env.example .env
How to use
-
Start the service
php -S 0.0.0.0:8080 -t ./public
-
Access your favorite browser in address with params to query:
http://127.0.0.1:8080/query?city=São Paulo&state=SP&country=BR
Expected
Return JSON with weather forecast or error message.
Licença
The MIT License (MIT). See the license file for more information.