Coder Social home page Coder Social logo

places's Introduction

Places API SAR Project

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

Requirements

Build and test project

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

Build , test and execute locally the lambda function

Check readme here

Package and Deploy

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)

Using npm (wrapping aws cli and sam cli)

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

Using aws cli

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"

The project uses

  • 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

places's People

Contributors

gpisacco avatar

Watchers

James Cloos 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.