mirror of
https://github.com/hanzoai/functions.git
synced 2026-10-30 15:04:37 +00:00
* Add websocket test Signed-off-by: Harsh Thakur <[email protected]> * Use trap for exit code Signed-off-by: Harsh Thakur <[email protected]> * Remove readme Signed-off-by: Harsh Thakur <[email protected]> * Format, go version fix Signed-off-by: Harsh Thakur <[email protected]> * Update image name Signed-off-by: Harsh Thakur <[email protected]> * Use spec dir Signed-off-by: Harsh Thakur <[email protected]> * Change directory before running file Signed-off-by: Harsh Thakur <[email protected]> * Use Signed-off-by: Harsh Thakur <[email protected]>
16 lines
339 B
JavaScript
16 lines
339 B
JavaScript
module.exports = async function(ws, clients) {
|
|
|
|
ws.on('message', function incoming(data) {
|
|
clients.forEach(function each(client) {
|
|
client.send(data);
|
|
});
|
|
});
|
|
|
|
ws.on('close', function close() {
|
|
return {
|
|
status: 200,
|
|
message: "I am done"
|
|
}
|
|
});
|
|
}
|