flerro / weather-api

A minimal serverless API implementation in Java, featuring Lambda + DynamoDB + HttpApi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weather-api

A minimal serverless API implementation in Java

Features:

  • Lambda + DynamoDB + HttpApi (a cheaper alternative to RestApi)
  • Custom implemetation for ApiGateway request/response format to reduce the deployable artifact size (not recommended, import aws-lambda-java-events instead)
  • reproducible builds, deploy using a ZIP file (no "Uberjar")

Please note:

Prerequisites

Usage

Build:

❯ mvn package

Deploy:

❯ sam deploy --guided

Invoke the remote endpoint:

❯ url=https://ae34eqcwlk.execute-api.eu-west-1.amazonaws.com/

# Add some data

❯ http $url/events < src/test/resources/oxford.json
❯ http POST $url/events < src/test/resources/brooklin.json

# Query data

❯ http GET $url/locations

Credits

This application is inspired by code examples from the great Programming AWS Lambda book.

About

A minimal serverless API implementation in Java, featuring Lambda + DynamoDB + HttpApi


Languages

Language:Java 100.0%