A template repository for a Smithy Typescript service hosted on AWS Lambda.
This repository is divided into three projects:
modelcontains the Smithy model for the service.typescript-clientcontains the generated TypeScript client generated frommodel.servercontains the service, written in TypeScript, formodel.
JDK >= 8, NodeJS >= 14, Yarn >= 2, and set up for the CDK.
- 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 ../../
- Next, run
yarn install && yarn buildto do the initial build of the entire project. - To deploy the service, run
cd server && yarn cdk deploy. When complete, the CDK will print out the value for your newly deployed service. - To test your service, switch to the
typescript-clientand useyarn str-lengthto call theLengthoperation. For example, given an output from the CDK ofhttps://somerandomstring.execute-api.us-west-2.amazonaws.com/prod/,should print outyarn str-length https://somerandomstring.execute-api.us-west-2.amazonaws.com/prod/ foobar
6.