Last active
May 5, 2020 06:31
-
-
Save vdelacou/eeb8931e510218dac1464d3cd592722c to your computer and use it in GitHub Desktop.
How to add AWS Amplify function typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.formatOnSave": true, | |
"editor.codeActionsOnSave": { | |
"source.organizeImports": true | |
}, | |
"typescript.tsdk": "node_modules\\typescript\\lib", | |
"files.autoSave": "afterDelay", | |
"search.exclude": { | |
"**/node_modules": true, | |
"**/.vscode": true, | |
"**/build": true | |
}, | |
"git.autofetch": true, | |
"javascript.format.enable": false, | |
"typescript.implementationsCodeLens.enabled": true, | |
"editor.trimAutoWhitespace": true, | |
"files.encoding": "utf8", | |
"files.trimFinalNewlines": true, | |
"files.trimTrailingWhitespace": true, | |
"eslint.validate": ["typescript"], | |
"eslint.workingDirectories": [{ "pattern": "amplify/backend/function/*/ts" }], | |
"[typescript]": { | |
"editor.formatOnSave": false, | |
"editor.codeActionsOnSave": { | |
"source.fixAll.eslint": true | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Callback, Context, Handler } from 'aws-lambda'; | |
interface TriggerEvent { | |
key1: string; | |
key2: string; | |
key3: string; | |
} | |
export const handler: Handler<TriggerEvent, string> = (event: TriggerEvent, context: Context, callback: Callback<string>) => { | |
const concatKey = `${event.key1} ${event.key2} ${event.key3}`; | |
callback(null, concatKey); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"declaration": false, | |
"target": "ES2017", | |
"module": "commonjs", | |
"moduleResolution": "node", | |
"rootDir": ".", | |
"lib": ["es2017"], | |
"typeRoots": ["node_modules/@types"], | |
"esModuleInterop": true, | |
"allowSyntheticDefaultImports": true, | |
"noImplicitAny": true, | |
"sourceMap": false, | |
"strict": true, | |
"baseUrl": ".", | |
"outDir": "../src" | |
}, | |
"include": ["./**/*"], | |
"exclude": ["node_modules"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment