Skip to content

Commit

Permalink
update APIGateway example with the new APIGatewayResponse initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
sebsto committed Dec 21, 2024
1 parent 25eb6e1 commit 3617120
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Examples/APIGateway/Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ let runtime = LambdaRuntime {
header["content-type"] = "application/json"

// echo the request in the response
let data = try encoder.encode(event)
let response = String(decoding: data, as: Unicode.UTF8.self)

return APIGatewayV2Response(statusCode: .ok, headers: header, body: response)
return try APIGatewayV2Response(statusCode: .ok, headers: header, encodableBody: event)
}

try await runtime.run()

0 comments on commit 3617120

Please sign in to comment.