https://github.com/fredericbarthelet/serverless-typescript
Serverless framework plugin for typescript specific ehancements
https://github.com/fredericbarthelet/serverless-typescript
serverless
Last synced: 11 months ago
JSON representation
Serverless framework plugin for typescript specific ehancements
- Host: GitHub
- URL: https://github.com/fredericbarthelet/serverless-typescript
- Owner: fredericbarthelet
- Created: 2020-02-26T18:04:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T08:40:32.000Z (about 3 years ago)
- Last Synced: 2025-04-18T09:34:24.922Z (11 months ago)
- Topics: serverless
- Language: TypeScript
- Homepage:
- Size: 924 KB
- Stars: 24
- Watchers: 2
- Forks: 1
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

[![Serverless][ico-serverless]][link-serverless]
A Serverless plugin improving typescript developer experience.
Lambda related configuration should be as close as possible from actually executed source code.
Target typical lambda structure :
```ts
import { Event, parseBody } from 'serverless-typescript/lib/api/input-validation';
interface MyHTTPBody {
param1: string;
param2: number;
}
/*
* @Security({'custom:role': Role.Superadmin})
* @Path('GET', '/api/{myParam}/list')
*/
export const main = async (event: Event): Promise => {
const input = parseBody(event);
console.log(input.param1);
//...
};
```
## Highlights
* [[AWS] API Gateway HTTP input validation based on typescript interfaces](./docs/input-validation.md)
* [AWS] API Gateway routing from annotation
* [AWS] Cognito custom attributes checking on request
## Install
```bash
$ npm install serverless-typescript --save-dev
```
Add the plugin to your `serverless.yml` file:
```yaml
plugins:
- serverless-typescript
```
[ico-serverless]: http://public.serverless.com/badges/v3.svg
[link-serverless]: http://www.serverless.com/