This repository contains a starter project template for Serverless projects running on AWS.
Built with Serverless and TypeScript.
This is a custom version of the default aws-nodejs-typescript
template in the Serverless
repository.
Here are the notable differences:
- comes with
@types/aws-lambda
for typed Lambda handler function definition - more verbose TypeScript configuration in
tsconfig.json
- no Webpack dependency or configuration needed; instead uses
serverless-plugin-typescript
- comes with the
serverless-offline
plugin for local development
Here are the steps to create a new project based on this template.
-
Install serverless globally.
npm install -g serverless
-
Create a new project based on this template, specifying the name for your new project.
serverless install --url https://github.com/echelon-solutions/aws-nodejs-typescript --name <my-new-project>
-
Install the project dependencies.
cd <my-new-project> npm install
Run a mocked local environment with hot-reload ...
npm run dev
This will start a mock API Gateway serving the Lambda functions you've defined.
Call the API at http://localhost:3000
.
Deploy the project to the cloud ...
npm run deploy
Browse the following resources for more information:
- Serverless documentation
- TypeScript documentation
- AWS documentation