1.0.7 • Published 2 years ago

@heytrip/specify-lambda-common v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Write your explicit Lambda function

// index.ts

import { specify, Get, Query, StatusCode, SnakeCase } from "specify-lambda"

@Get()
export class Request {
  @Query("username")
  username: string;
}

@StatusCode(200)
export class Response {
  @SnakeCase()
  readonly body: {
    readonly message: string
  }
}

export const handler = specify(
  Request,
  Response,
)(async ({ username }) => {
  const message = `Hello ${username || "world"}!`
  
  return {
    body: { message },
  }
})
1.0.7

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago