A simple server that proxies requests to Dark Sky API without exposing the Dark Sky API Key. Designed to be deployed to AWS Lambda.
> mkvirtualenv weather-api-server
> pip install aws-sam-cli
> npm use
> npx tsc -w
> infrastructure/scripts/package.sh
> DARK_SKY_API_KEY=${DARK_SKY_API_KEY} sam local invoke \
"WeatherFunction" --template infrastructure/sam.yaml \
-e test/data/events/apigateway-event.json
> infrastructure/scripts/package.sh && \
aws cloudformation package \
--template-file infrastructure/sam.yaml \
--s3-bucket ${S3_BUCKET} \
--s3-prefix ${S3_PRFIX} \
--output-template-file dist/weather-api-server.cfn
> npm run cf-deploy-stack \
${DARK_SKY_API_KEY} ${DOMAIN_ALLOWED_FOR_CORS} ${STACKNAME}
e.g. npm run cf-deploy-stack abc123456 http://www.example.com my-weather-api-stack