Skip to content

adamthom-amzn/smithy-ts-devx-walkthrough

Repository files navigation

smithy-typescript-template-lambda-service

A Smithy Typescript service hosted on AWS Lambda.

Overview

This repository is divided into three projects:

  • model contains the Smithy model for the service.
  • typescript-client contains the generated TypeScript client generated from model.
  • server contains the service, written in TypeScript, for model.

Building

Prerequisites

Before beginning:

Getting started

  1. After the first checkout, you will need to kick off the initial code generation by running:
    cd model
    ./gradlew build pTML
    cd ../typescript-client/codegen
    ./gradlew clean build
    cd ../../server/codegen
    ./gradlew clean build
    cd ../../
  2. Next, run yarn install && yarn build to do the initial build of the entire project.
  3. To deploy the service, run cd server && yarn cdk deploy. When complete, the CDK will print out the endpoint URL for your newly deployed service.

    Note: this step will create resources in your AWS account that may incur charges.

  4. To test your service, switch to the typescript-client directory and use yarn str-length to call the Length operation. For example, given an output from the CDK of https://somerandomstring.execute-api.us-west-2.amazonaws.com/prod/,
    yarn str-length https://somerandomstring.execute-api.us-west-2.amazonaws.com/prod/ foobar
    should print out 6.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published