I am using serverless framework to set up an AWS API Gateway websocket which calls a lambda function written in Go. Right now the handler only logs a message. I can connect to the websocket, and I can see the message is logged in Cloudwatch when I send a message through the socket, but I always get an error message that looks like
{
"message": "Internal server error",
"connectionId": "eU3C1cE7CYcCJPw=",
"requestId": "eU3EQFX0iYcFysQ="
}
There are no errors logged for the lambda in Cloudwatch. The AWS API Gateway config looks good to me. I'm at a loss trying to think of what could cause this.
My main.go:
package main
import (
"fmt"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
)
func Handler(request events.APIGatewayWebsocketProxyRequest) {
fmt.Println("default function ran")
}
func main() {
lambda.Start(Handler)
}
Probably not super relevant but the serverless.yaml config:
functions:
websocket-default:
handler: bin/ws
events:
- websocket:
route: $default
The payload I'm sending:
{
"action": "whatever",
"data": "{whatever}"
}