This project holds a lambda function that gets information about near hotels from HERE api.
It can be deployed using cloudformation command or from AWS SAR Repository.
Test site is located in here
Coverage information is located in here
The API can be tested in https://wbn8k2tvi2.execute-api.us-east-1.amazonaws.com/Prod/places?latlong=52.51577,13.38022
- HERE api appId, appCode and BaseURL set in src/places/env.json
- Those values should be obtained from HERE website https://developer.here.com/develop/rest-apis
npm install # to install deps
npm test # run unit test
npm run test:cov #generates coverage doc
npm build # generates coverage and swagger ui testing site
npm run package <bucket> # packages sam application
npm run deploy HereAppId=??? HereAppCode=??? HereBaseURL=https://places.demo.api.here.com/places/v1 # deploy application to aws
Check readme here
The application has been created and set up a SAM application hosted in AWS SAR repository, it can be deployed in 3 ways:
From AWS SAR repository (easier)
npm run package <bucket> # packages sam application
npm run deploy HereAppId=??? HereAppCode=??? HereBaseURL=https://places.demo.api.here.com/places/v1 # deploy application to aws
sam package --template-file src/template.yaml --output-template-file packaged.yaml --s3-bucket <your-bucket>
aws cloudformation deploy --template-file packaged.yaml --stack-name places --capabilities CAPABILITY_IAM --parameter-overrides "HereAppId=???" "HereAppCode=???" "HereBaseURL=https://places.demo.api.here.com/places/v1"
- Lambda (API Function) to process the requests
- API Gateway (HTTP proxy to Lambda) to handle the HTTP part
- Cloudformation (SAM) for deployment
- Jest for unit testing and coverage (it uses embedded istambul in order to calculate the coverage and generate the html output)
- Swagger UI for testing
- Webpack to build the swagger site