Skip to content

Instantly share code, notes, and snippets.

@mtimbs
Last active February 27, 2020 15:01
Show Gist options
  • Save mtimbs/965bde6e3d829e3e3417c6d2a44c84ac to your computer and use it in GitHub Desktop.
Save mtimbs/965bde6e3d829e3e3417c6d2a44c84ac to your computer and use it in GitHub Desktop.
example API Gateway handler for serverless framework using module aliasing for imports
import { APIGatewayProxyHandler } from ‘aws-lambda';
import { echo } from ‘@queries/exampleQuery';
import 'source-map-support/register’;
export const hello: APIGatewayProxyHandler = async (event) => ({
statusCode: 200,
body: JSON.stringify({
message: echo(‘Module aliasing is really the best’),
input: event,
}, null, 2),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment