bjos19/anax-weathermodule

V1.0.4 2020-12-10 15:49 UTC

This package is auto-updated.

Last update: 2024-04-10 23:33:35 UTC


README

Badges

Travis-CI
Build Status
CircleCI
<ORG_NAME>
Scrutinzer
Scrutinizer Code Quality
Code Coverage
Build Status
Code Intelligence Status
Codeclimate
Maintainability
SymfonyInsight
SymfonyInsight

Installing

This module is available on packagist

Step 1 install the module

install using composer

composer require bjos19/anax-weathermodule

Step 2 Copy the configuration files and other necessary folders.

You can copy all the files separately from vendor/bjos19/anax-weathermodule or stand in the root of your Anax repo and copy all files with the following commands:

rsync -av vendor/bjos19/anax-weathermodule/config ./
rsync -av vendor/bjos19/anax-weathermodule/src ./
rsync -av vendor/bjos19/anax-weathermodule/view ./
rsync -av vendor/bjos19/anax-weathermodule/test ./

Step 3 Add namespace

Add namespace Bjos to composer.json and run command composer dump-autoload.

"autoload": {
    "psr-4": {
        "Anax\\": "src/",
        "Bjos\\": "src/"
    }
},

Test

Run command make test to check that the code validates.

To be able to use the module properly you have to add 2 api-keys

Add api key from ipstack

Create file /config/api_ipstack.php and copy the code below or rename the file /config/api_ipstack_sample.php.

<?php

return [
    "apiKey" => "Replace this with valid Apikey"
];

Add api key from openweathermap one-call-api

Create file /config/api_owm.php and copy the code below or rename the file /config/api_owm_sample.php.

<?php

return [
    "apiKey" => "Replace this with valid Apikey"
];

Routes

After you have followed the steps above the following routes is available.

/api
/weather
/weatherapi
/ip
/ip-json
/geo
/geoapi