forecast-service

command module
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2016 License: MIT Imports: 15 Imported by: 0

README

forecast-service Circle CI

A pass-through microservice for the forecast.io API and pollen data

To build, make sure you have the latest version of Go installed. If you've never used Go before, it's a quick install and there are installers for multiple platforms, including Windows, Linux and OSX.

Quick Start

Run the following commands get latest and build.

go get github.com/danesparza/forecast-service
go build
Starting and testing the service

To start the service, just run forecast-service.

If you need help, just run forecast-service --help.

There are a few command line parameters available:

Parameter Description
apikey The Forecast.io api key use for making calls. You'll need to supply your own key, but they are free. You can get one at the Forecast.io developer site
port The port the service listens on.
allowedOrigins comma seperated list of CORS origins to allow. In order to access the service directly from a javascript application, you'll need to specify the origin you'll be running the javascript site on. For example: http://www.myjavascriptapplication.com

Once the service is up and running, you can connect to it using http://yourhostname:3000/forecast/lat,long where lat and long are the latitude and longitude you'd like to get weather for.

Example: http://yourdomain.com:3000/forecast/34.0487043,-84.22674289999999

To test your service quickly, you can use the Postman Google Chrome Extension to call the service and see the JSON return format.

Weather information will be returned as a JSON payload outlined on the Forecast.io website.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL