Skip to content

Instantly share code, notes, and snippets.

@wenindoubt
Forked from fredericbarthelet/functions.ts
Created June 30, 2021 19:27
Show Gist options
  • Select an option

  • Save wenindoubt/2d04f64c447b4f37e2195a8eec6076b0 to your computer and use it in GitHub Desktop.

Select an option

Save wenindoubt/2d04f64c447b4f37e2195a8eec6076b0 to your computer and use it in GitHub Desktop.

Revisions

  1. @fredericbarthelet fredericbarthelet revised this gist Oct 14, 2020. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions hello.ts
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    import path from 'path';

    // Lambda configuration is at the same location of the actual handler's code

    export default {
  2. @fredericbarthelet fredericbarthelet created this gist Oct 11, 2020.
    2 changes: 2 additions & 0 deletions functions.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    export { default as hello } from './hello';
    export { default as goodbye } from './goodbye';
    14 changes: 14 additions & 0 deletions hello.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    import path from 'path';

    // Lambda configuration is at the same location of the actual handler's code

    export default {
    handler:'hello.main',
    events: [
    { httpApi: 'GET /hello'}
    ]
    }

    const main = () => {
    return 'Hello from lambda'
    }
    12 changes: 12 additions & 0 deletions serverless.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import functions from './functions';

    const serverlessConfiguration: Serverless = {
    service: 'myServerlessService',
    provider: {
    name: 'aws',
    runtime: 'nodejs12.x'
    },
    functions
    };

    module.exports = serverlessConfiguration;