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: 2 months 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-08T01:26:18.000Z (over 2 years ago)
- Last Synced: 2025-03-26T17:28:23.464Z (over 1 year ago)
- Topics: aws, aws-lambda, darksky, darksky-api, terraform, weather, weather-api
- Language: HCL
- Homepage:
- Size: 1010 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DarkSky API pass-through proxy server
[](https://github.com/ayltai/passthrough-proxy-darksky/actions)

[](https://github.com/ayltai/passthrough-proxy-darksky/releases)
[](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