weather 简单服务器提供来自公共API的天气数据(按IACA代码和日期)
天气API简单的JSON API从三个来源按日期提供IATA区域的平均温度:OpenWeatherMap、WorldWeatherOnline和Wunderground。安装步骤:
-
git clone
并进入项目目录:git clone weather && cd weather
-
安装依赖:
npm install
-
复制配置文件:
cp config.sample.json config.json
注意:不要忘记在配置文件中设置您的API密钥。
要启动服务器,请执行以下命令:
node index
测试命令:
npm test
API使用示例:
API 需要两个参数:IATA代码和日期(可以使用 Date()
解析的任何格式)。示例命令:
$ curl http://localhost:8030/VKO/2014-11-21
{\"temp\":-4.93}
下载地址
用户评论