Linting aws-ts-apigateway-lambda-serverless
MODIFY
aws-ts-apigateway-lambda-serverless/handler.ts
aws-ts-apigateway-lambda-serverless/handler.ts
-'use strict'
+// Copyright 2016-2019, Pulumi Corporation. All rights reserved.
-import { APIGatewayProxyEvent, APIGatewayProxyResult } from 'aws-lambda';
-import * as aws from '@pulumi/aws';
+import * as aws from "@pulumi/aws";
+import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
/**
* A simple function that returns the request.
@@ -13,16 +13,16 @@ export const handler: aws.lambda.EventHandler<APIGatewayProxyEvent, APIGatewayPr
const route = event.pathParameters!["route"];
const body = event.body ? JSON.parse(event.body) : null;
- console.log('Received body: ', body);
+ console.log("Received body: ", body);
return {
statusCode: 200,
body: JSON.stringify({
route,
affirmation: "Nice job, you've done it! :D",
- requestBodyEcho: body
- })
- }
-}
+ requestBodyEcho: body,
+ }),
+ };
+};
export default handler;

MODIFY
aws-ts-apigateway-lambda-serverless/index.ts
aws-ts-apigateway-lambda-serverless/index.ts
+// Copyright 2016-2019, Pulumi Corporation. All rights reserved.
+
import * as awsx from "@pulumi/awsx";
-import handler from './handler';
+import handler from "./handler";
/**
* api-gatewayx https://www.pulumi.com/docs/guides/crosswalk/aws/api-gateway/
*/
// Create an API endpoint.
-let endpoint = new awsx.apigateway.API("hello-world", {
+const endpoint = new awsx.apigateway.API("hello-world", {
routes: [
{
path: "/{route+}",
method: "GET",
// Functions can be imported from other modules
- eventHandler: handler
+ eventHandler: handler,
},
{
path: "/{route+}",
method: "POST",
// Functions can be created inline
eventHandler: (event) => {
- console.log('Inline event handler');
+ console.log("Inline event handler");
console.log(event);
- }
+ },
},
{
path: "/{route+}",
method: "DELETE",
// Functions can be created inline
eventHandler: (event) => {
- console.log('Inline delete event handler');
+ console.log("Inline delete event handler");
console.log(event);
- }
+ },
},
],
});

Linting aws-ts-apigateway-lambda-serverless