Having some issues with the websocket api not enti...
# help
g
Having some issues with the websocket api not entirely sure what I am doing wrong. In my stack I have:
Copy code
new WebSocketApi(this, 'WebSocketApi', {
	routes: {
		$connect: 'src/functions/actions/websocket/connect.handler'
	}
})
And the lambda code is:
Copy code
export const handler = (event: unknown) => {
	console.log(event)
	return {
		statusCode: 200,
		body: 'test'
	}
}
It logs the event just fine, but every websocket just immediately disconnects.
t
Can you try specifying a handler for $disconenct and seeing if it logs anything
I haven't use the WebsocketAPi construct yet so not super familiar with it
Is it possible the handler is expecting a promise? Does marking the function
async
help?
g
Ah yeah it required a promise. Thanks.