Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/walterwoshid/amplify-typescript-function
This allows you to use TypeScript in your Amplify Lambda Functions.
https://github.com/walterwoshid/amplify-typescript-function
amplify aws typescript
Last synced: 9 days ago
JSON representation
This allows you to use TypeScript in your Amplify Lambda Functions.
- Host: GitHub
- URL: https://github.com/walterwoshid/amplify-typescript-function
- Owner: WalterWoshid
- Created: 2022-08-02T22:58:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-07T17:40:57.000Z (over 2 years ago)
- Last Synced: 2023-03-11T08:22:52.970Z (almost 2 years ago)
- Topics: amplify, aws, typescript
- Language: TypeScript
- Homepage:
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Amplify TypeScript Function Skeleton
---
## Usage:
1. Create a new Amplify function: `amplify function add`
2. Remove all contents from your new functions `src` folder, but keep the `index.js` file (so it can copy the 'Amplify Params' comment)
3. Add all files from this project to the `src` folder
From your Amplify project root, run the mock command:
```
amplify mock function yourFunctionName --event src/event.json
```That's it!
---
## Note:
Auto build:
- The `postinstall` section in the `package.json` will compile the TypeScript file into `index.js`
Amplify Params Comment:
- Add the `Amplify Params` comment from your original `index.js` or run `amplify function update yourFunctionName` and let Amplify add it again
- You can also add the comment to the `index.ts` file and it will include it into your `index.js` file
- It will not use the comment from the `index.ts` file if a `index.js` file exists and already has an Amplify comment to ensure that the `build` method always uses the newest comment