Giter VIP home page Giter VIP logo

echo-serverless-sample's Introduction

echo-serverless

サンプルプロジェクト

Lambda Function と API Gateway で REST API を作成して CDK でデプロイする。 Lambda Function は TypeScript で実装して Jest でテストを実行する。

  • API Gateway REST API
  • Lambda Function
  • TypeScript & Jest
  • CDK
    • Route53
    • ACM

CDK Context

CDK の Context を利用して環境別の設定を切り替える。

  • stageName: 環境名。API Gateway のステージ名にも利用する。
  • customDomain: REST API をデプロイするドメイン。
  • hostedZoneId: Route53 で作成済みの PublicHostedZoneId。

仕様

echo

送信した文字列をオウム返しする.

curl -X POST 'https://prod.example.com/v1/echo' -d 'Hello, World!'
#=> Hello, World!

curl -X POST 'https://prod.example.com/v1/echo?options=uppercase' -d 'Hello, World!'
#=> HELLO, WORLD!

time

サーバーサイドの現在日時を ISO 8601 形式で返す.

curl 'https://prod.example.com/v1/time'
#=> 2022-12-15T14:28:00Z

info

AWS Lambda の環境変数、イベント、コンテキスト情報を表示する.

curl 'https://prod.example.com/v1/info'
curl -X POST 'https://prod.example.com/v1/info'

echo-serverless-sample's People

Contributors

grohiro avatar

Watchers

 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.