这是一个用[email protected]
制作的天气类web app。
天气数据的接口用了"肥肠不友好的"免费版心知天气API。
另外还搭建了一个简单的node后端服务器来解决请求数据时的前端跨域问题,即./cross-origin-server.js
。
天气动画特效借鉴自:https://codepen.io/EvanWieland/pen/PwOKLE 。
点击访问预览:Angular-Weather
手机扫一扫预览:
- 环境配置
- 考虑使用
Observable.zip
- ......
git clone https://github.com/JuniorTour/angular-weather.git
cd angular-weather
cnpm i
npm run CSOR-API // 开发环境下启动跨域服务器后,可以通过localhost:3001获取转发的数据。
ng s // 开发环境下以 angular-cli 在 localhost:4201 启动
npm run build-prod // 生产环境打包
npm run prod // 生产环境下编译打包后在 localhost:4201 启动