All Projects → AnomalyInnovations → serverless-typescript-starter

AnomalyInnovations / serverless-typescript-starter

Licence: MIT license
A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to serverless-typescript-starter

a-crash-course-on-serverless-with-nodejs
A quick and easy guide of how to hook up a single Serverless service.
Stars: ✭ 28 (-62.67%)
Mutual labels:  serverless-framework, serverless-offline
serverless-plugin-offline-kinesis-events
⚡ Serverless plugin that works with serverless-offline to allow offline testing of Serverless functions that are triggered by Kinesis events.
Stars: ✭ 15 (-80%)
Mutual labels:  serverless-framework, serverless-offline
serverless-multicloud-example
An example Node Express app that can be deployed in any major cloud by the Serverless framework
Stars: ✭ 20 (-73.33%)
Mutual labels:  serverless-framework
lambda-sns-dlq-error-handling
Sample project for showing the ability to publish an SNS topic and trigger a function from the topic. Code is structured to create a timeout/crash so the dead letter queue SNS topic gets published, in turn triggering the error handler function.
Stars: ✭ 31 (-58.67%)
Mutual labels:  serverless-framework
fastapi-mangum-example
Deploy FastAPI as Lambda using serverless and mangum
Stars: ✭ 21 (-72%)
Mutual labels:  serverless-framework
lambdog-server
Write Netlify functions without pulling your hair out.
Stars: ✭ 15 (-80%)
Mutual labels:  serverless-framework
serverless-aws-rust
⚡🏗️ template for new aws lambda serverless rust apps
Stars: ✭ 89 (+18.67%)
Mutual labels:  serverless-framework
aws-secure-websockets
Secure web socket implementation using AWS products and serverless framework
Stars: ✭ 49 (-34.67%)
Mutual labels:  serverless-framework
serverless
BlueNimble is a Hybrid Serverless Platform focusing on developer productivity and application portability. Create and run scalable APIs and applications without coding or by coding less. Focus on application business logic without any knowledge of the underlying microservices architecture.
Stars: ✭ 30 (-60%)
Mutual labels:  serverless-framework
serverless-authorizers
Examples to use aws API Gateway authorizer feature to authorize your endpoints with different ways
Stars: ✭ 31 (-58.67%)
Mutual labels:  serverless-framework
serverless-swagger-api
Simplifies the process of generating an API Gateway API from a swagger file.
Stars: ✭ 15 (-80%)
Mutual labels:  serverless-framework
lambda-mailer
Simple module for receiving an email from a contact form on your website.
Stars: ✭ 83 (+10.67%)
Mutual labels:  serverless-framework
lockbot
🔒 Coordinate use of your team's shared resources, in Slack 🤝
Stars: ✭ 47 (-37.33%)
Mutual labels:  serverless-framework
serverless-aws-rust-multi
⚡🏗️ template for new aws lambda serverless rust http apps
Stars: ✭ 51 (-32%)
Mutual labels:  serverless-framework
cloudwatch-public-metrics
Expose AWS Cloudwatch Metrics as a public HTML page using AWS Lambda and server-side rendering
Stars: ✭ 27 (-64%)
Mutual labels:  serverless-framework
serverlesscloud.cn
Serverless 中文网
Stars: ✭ 15 (-80%)
Mutual labels:  serverless-framework
serverless-modular
⚡️ serverless plugin for microservice code management and deployment.
Stars: ✭ 19 (-74.67%)
Mutual labels:  serverless-framework
tencent-cam-policy
Easily create an Tencent CAM Policy with Serverless Components
Stars: ✭ 20 (-73.33%)
Mutual labels:  serverless-framework
serverless-scaleway-functions
Plugin for Serverless Framework to allow users to deploy their serverless applications on Scaleway Functions
Stars: ✭ 58 (-22.67%)
Mutual labels:  serverless-framework
serverless-fission
Use Fission through Serverless Framework https://serverless.com
Stars: ✭ 19 (-74.67%)
Mutual labels:  serverless-framework

Serverless TypeScript Starter Seed Status

A Serverless starter that adds TypeScript, serverless-offline, linting, environment variables, and unit test support.

This starter uses the serverless-bundle plugin and the serverless-offline plugin. It supports:

  • Generating optimized Lambda packages with Webpack
  • Using TypeScript in your handler functions and tests
  • Run API Gateway locally
    • Use serverless offline start
  • Support for unit tests
    • Run npm test to run your tests
  • Sourcemaps for proper error messages
    • Error message show the correct line numbers
    • Works in production with CloudWatch
  • Lint your code with ESLint
  • Add environment variables for your stages
  • No need to manage Webpack or Babel configs

Demo

A demo version of this service is hosted on AWS - https://ylsml6v6r6.execute-api.us-east-1.amazonaws.com/dev/hello

And here is the TS source behind it

export async function hello(
  event: APIGatewayEvent,
  context: Context
): Promise<APIGatewayProxyResult> {
  return {
    statusCode: 200,
    body: JSON.stringify({
      message: "Go Serverless v2.0! Your function executed successfully!",
      context,
      event,
    }),
  };
}

Requirements

Installation

To create a new Serverless project.

$ serverless install --url https://github.com/AnomalyInnovations/serverless-typescript-starter --name my-project

Enter the new directory

$ cd my-project

Install the npm packages

$ npm install

Usage

To run a function on your local

$ serverless invoke local --function hello

To simulate API Gateway locally using serverless-offline

$ serverless offline start

Deploy your project

$ serverless deploy

Deploy a single function

$ serverless deploy function --function hello

Running Tests

Run your tests using

$ npm test

We use Jest to run our tests. You can read more about setting up your tests here.

Environment Variables

To add environment variables to your project

  1. Rename env.example to .env.
  2. Add environment variables for your local stage to .env.
  3. Uncomment environment: block in the serverless.yml and reference the environment variable as ${env:MY_ENV_VAR}. Where MY_ENV_VAR is added to your .env file.
  4. Make sure to not commit your .env.

Linting

We use ESLint to lint your code via serverless-bundle.

You can turn this off by adding the following to your serverless.yml.

custom:
  bundle:
    linting: false

To override the default config, add a .eslintrc.json file. To ignore ESLint for specific files, add it to a .eslintignore file.

Support

  • Open a new issue if you've found a bug or have some suggestions.
  • Or submit a pull request!

This repo is maintained by Anomaly Innovations; makers of Seed and Serverless Stack.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].