Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ayltai/passthrough-proxy-darksky
A pass-through proxy to communicate with DarkSky API server
https://github.com/ayltai/passthrough-proxy-darksky
aws aws-lambda darksky darksky-api terraform weather weather-api
Last synced: 8 days ago
JSON representation
A pass-through proxy to communicate with DarkSky API server
- Host: GitHub
- URL: https://github.com/ayltai/passthrough-proxy-darksky
- Owner: ayltai
- License: mit
- Created: 2021-08-18T07:06:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-19T03:48:12.000Z (over 1 year ago)
- Last Synced: 2023-08-06T11:54:55.282Z (over 1 year ago)
- Topics: aws, aws-lambda, darksky, darksky-api, terraform, weather, weather-api
- Language: HCL
- Homepage:
- Size: 907 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DarkSky API pass-through proxy server
[![GitHub workflow status](https://img.shields.io/github/workflow/status/ayltai/passthrough-proxy-darksky/CI?style=flat)](https://github.com/ayltai/passthrough-proxy-darksky/actions)
![Maintenance](https://img.shields.io/maintenance/yes/2021)
[![Release](https://img.shields.io/github/release/ayltai/passthrough-proxy-darksky.svg?style=flat)](https://github.com/ayltai/passthrough-proxy-darksky/releases)
[![License](https://img.shields.io/github/license/ayltai/passthrough-proxy-darksky.svg?style=flat)](https://github.com/ayltai/passthrough-proxy-darksky/blob/master/LICENSE)A pass-through proxy to communicate with [DarkSky](https://darksky.net) API server.
## How it works
It acts as a simple web proxy that sends all requests it receives to `https://api.darksky.net`. You may need to send your secret key to the proxy if it is a protected API. Check the official [documentation](https://darksky.net/dev/docs).
The proxy runs on AWS Lambda.
## Supported APIs
* `/forecast`
## Setup
[Terraform](https://www.terraform.io) is used for deployment on AWS.
### Development
[LocalStack](https://localstack.cloud) is used to provide local AWS services.
**Requirements**
* [Docker](https://www.docker.com)
**Steps**
1. Start LocalStack
```shell
docker run --rm -it -p 4566:4566 -p 4571:4571 -e "SERVICES=iam,lambda,apigateway,cloudwatch,logs,sts" localstack/localstack
```
2. Run Terraform scripts
```shell
cd terraform/local
terraform init
terraform apply -auto-approve
```
3. Take note of the outputs when Terraform completes. Example:
```shell
Outputs:rest_api_url = "http://localhost:4566/restapis/7rujauhl95/api/_user_request_"
```
4. Test the deployed endpoint
```shell
curl http://localhost:4566/restapis/7rujauhl95/api/_user_request_/forecast/[secretKey]/[latitude],[longitude]
```### Production
**Requirements**
* Have an AWS account ready. We will need the Access and Secret Keys to run the Terraform scripts.
* Have a Terraform account ready. We will need it to store the Terraform states.**Steps**
1. Run Terraform scripts
```shell
cd terraform/remote
terraform init
terraform apply -auto-approve
```
2. Take note of the outputs when Terraform completes
3. Test the deployed endpoint