chbl / weather
天气服务模块。
v2.0.3
2020-12-04 13:57 UTC
Requires
- php: >=7.2
- anax/anax-cli: ^1.2
- anax/anax-ramverk1-me: ^1.0.0
- anax/commons: ^2.0.14
Requires (Dev)
- anax/anax: ^2.0.17
- phpmetrics/phpmetrics: ^2
- phpunit/phpunit: ^7
README
Anax (在 ramverk1 仓库中使用) 的天气模块
ramverk1 课程中使用的模块,使用 PHP 框架 Anax。
安装
composer require chbl/weather
`make install`
`make install test`
要运行测试,请使用 make test
,但请记得先添加您的API密钥。
以下有进一步说明!
复制配置
rsync -av vendor/chbl/weather/config/ config/
rsync -av vendor/chbl/weather/src/ src/
rsync -av vendor/chbl/weather/test/ test/
rsync -av vendor/chbl/weather/view/ view/
添加您的个人API密钥
在config/文件夹中创建文件 weatherapi.php
和 apikey.php
,
将以下内容粘贴到 weatherapi.php 并将 xxx 替换为您的API密钥。
`
return [
"weatherKeyHolder" => [
"weatherKey" => "xxx",
"mapboxKey" => "xxx"
]
];`
为您的 GetGeolocation API,执行相同的操作,但使用以下代码,并将其粘贴到 apikey.php
中,
`
return ["keyHolder" => ["apiKey" => "x"]];`
结构
天气服务将在 /weather
下可用,IP 服务将在 /validate
下可用