Git Product home page Git Product logo

passthrough-proxy-openweathermap's Introduction

OpenWeatherMap API pass-through proxy server

GitHub workflow status Maintenance Release License

A pass-through proxy to communicate with OpenWeatherMap API server.

How it works

It acts as a simple web proxy that sends all requests it receives to https://api.openweathermap.org. You may need to send your secret key to the proxy if it is a protected API. Check the official documentation.

The proxy runs on AWS Lambda.

Supported APIs

  • /data/2.5/onecall

Setup

Terraform is used for deployment on AWS.

Development

LocalStack is used to provide local AWS services.

Requirements

Steps

  1. Start LocalStack
    docker run --rm -it -p 4566:4566 -p 4571:4571 -e "SERVICES=iam,lambda,apigateway,cloudwatch,logs,sts" localstack/localstack
  2. Run Terraform scripts
    cd terraform/local
    terraform init
    terraform apply -auto-approve
  3. Take note of the outputs when Terraform completes. Example:
    Outputs:
    
    rest_api_url = "http://localhost:4566/restapis/7rujauhl95/api/_user_request_"
  4. Test the deployed endpoint
    curl http://localhost:4566/restapis/7rujauhl95/api/_user_request_/data/2.5/onecall?appid=aaabbbccc&lat=22.3193&lon=114.1694&exclude=minutely,alerts&units=metric&lang=en

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
    cd terraform/remote
    terraform init
    terraform apply -auto-approve
  2. Take note of the outputs when Terraform completes
  3. Test the deployed endpoint

passthrough-proxy-openweathermap's People

Contributors

ayltai avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.