From 014ecfc00cea5233f383165963c35d8a170e708c Mon Sep 17 00:00:00 2001 From: "R. Duthie" <343584+rjaduthie@users.noreply.github.com> Date: Fri, 20 Jan 2023 00:20:59 +0000 Subject: [PATCH] Fix updownstatus API lambda handler export --- resources/serverstatus.ts | 3 +-- resources/startstopserver.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/resources/serverstatus.ts b/resources/serverstatus.ts index 648acb1..810133f 100644 --- a/resources/serverstatus.ts +++ b/resources/serverstatus.ts @@ -35,7 +35,7 @@ const ec2Client = new EC2Client({ region: REGION }); /** * Everything here has the assumption there is only one task. */ -const handler: APIGatewayProxyHandler = async (event: APIGatewayEvent, context: Context) => { +exports.handler = async (event: APIGatewayEvent, context: Context) => { console.log(`New getServerStatus request: ${JSON.stringify(event)}`); console.log(`With context: ${JSON.stringify(context)}`); @@ -50,7 +50,6 @@ const handler: APIGatewayProxyHandler = async (event: APIGatewayEvent, context: }; }; -export default handler; async function getIPFunction() { diff --git a/resources/startstopserver.ts b/resources/startstopserver.ts index e20dd15..fd3ecca 100644 --- a/resources/startstopserver.ts +++ b/resources/startstopserver.ts @@ -26,7 +26,7 @@ const SERVICE_NAME = process.env.SERVICE_NAME; const CLUSTER_ARN = process.env.CLUSTER_ARN; const PASSWORD = process.env.PASSWORD; -const handler: APIGatewayProxyHandler = async (event: APIGatewayEvent, context: Context) => { +exports.handler = async (event: APIGatewayEvent, context: Context) => { console.log("request: " + JSON.stringify(event)); let responseCode = 400; let message = "authentication failed"; @@ -78,5 +78,3 @@ const handler: APIGatewayProxyHandler = async (event: APIGatewayEvent, context: body: JSON.stringify(responseBody) }; }; - -export default handler;