* @license GPLV3 gpl.com * @link itsblue.de */ require_once './config.php'; require_once './blueweather.php'; header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); $blueweather = new BlueWeather($config); if (isset($_GET['locId'])) { // get data of given location $data = $blueweather->getLocationData( $_GET['locId'], $_GET['range'], $_GET['maxVals'] ); } else { $data = $blueweather->getAllLocations(); } http_response_code(200); echo json_encode($data);