README.md
March 6, 2023 ยท View on GitHub
Smithy Server Generator for TypeScript Example Service
Overview
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.
Building
Prerequisites
Before beginning:
- Install
- JDK >= 8
- NodeJS >= 14
- AWS CDK CLI
- Enable corepack by running
corepack enable - Set up an AWS account if you do not have one
- Configure your workstation so the CDK can use your account
Getting started
- After the first checkout, you will need to kick off the initial code generation and build by running:
After this initial build,./gradlew build && yarn install && yarn buildyarn buildin the root of the project will regenerate the client and server and recompile all of the code. - To deploy the service, switch to the
serverdirectory and runcdk 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.
- To test your service, switch to the
typescript-clientdirectory and 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/ foobar6.
Security
See CONTRIBUTING for more information.
License
This library is licensed under the MIT-0 License. See the LICENSE file.