import './services/example.service' ; import axios from 'axios' ; import echoThisString , { consoleLogSomething } from './services/example.service' ; const url = 'http://checkip.amazonaws.com/' ; let response ; param event param { string } event . resource param { string } event . path param { string } event . httpMethod param { Object } event . headers param { Object } event . queryStringParameters param { Object } event . pathParameters param { Object } event . stageVariables param { Object } event . requestContext param event . body param { boolean } event . body . isBase64Encoded param context param { string } context . logGroupName param { string } context . logStreamName param { string } context . functionName param { string } context . memoryLimitInMB param { string } context . functionVersion param { function } context . getRemainingTimeInMillis param { string } context . awsRequestId param { string } context . invokedFunctionArn returns { Object } returns { boolean } returns { string } returns { Object } returns { Object } export async function lambdaHandler ( event , context ) { try { const ret = await axios ( url ) ; consoleLogSomething ( ) ; response = { 'statusCode' : 200 , 'body' : JSON . stringify ( { message : echoThisString ( 'hello world' ) , location : ret . data . trim ( ) } ) } ; } catch ( err ) { console . log ( err ) ; return err ; } return response ; } ;