项目作者: willrax

项目描述 :
An example of using Glimmer to fetch and display local weather ✨ ☀️
高级语言: TypeScript
项目地址: git://github.com/willrax/glimmer-weather.git
创建时间: 2017-04-08T08:40:17Z
项目社区:https://github.com/willrax/glimmer-weather

开源协议:

下载


Glimmer Weather

A small Glimmer application to fetch your current location and display the daily summary.

Installation

  • git clone git@github.com:willrax/glimmer-weather.git
  • cd weather
  • yarn
  • ember serve

Fetching the Report

This app assumes that you’re using the Darksky API. You’ll also need to proxy these requets due to CORS. Here’s a small Node app that can do it.j

  1. var express = require('express');
  2. var request = require('request');
  3. var cors = require('cors');
  4. var app = express();
  5. var apiServerHost = 'https://api.darksky.net/forecast/<YOUR_API_TOKEN>';
  6. app.use(cors());
  7. app.use('/', function(req, res) {
  8. var url = apiServerHost + req.url;
  9. req.pipe(request(url)).pipe(res);
  10. });
  11. app.listen(process.env.PORT || 4000);

You’ll just need to install express, request and cors to get it working. Then fill in your API_TOKEN.