File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/pages/[platform]/build-a-backend/data/connect-event-api Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -82,9 +82,10 @@ export default function App() {
82
82
}, []);
83
83
84
84
async function publishEvent() {
85
+ // Publish via HTTP POST
85
86
await events .post (' default/channel' , { some: ' data' });
86
87
87
- // Alternative way to publish events through the channel
88
+ // Alternatively, publish events through the WebSocket channel
88
89
const channel = await events .connect (' default/channel' );
89
90
await channel .publish ({ some: ' data' });
90
91
}
@@ -244,9 +245,10 @@ export default function App() {
244
245
}, []);
245
246
246
247
async function publishEvent() {
248
+ // Publish via HTTP POST
247
249
await events .post (' default/channel' , { some: ' data' });
248
250
249
- // Alternative way to publish events through the channel
251
+ // Alternatively, publish events through the WebSocket channel
250
252
const channel = await events .connect (' default/channel' );
251
253
await channel .publish ({ some: ' data' });
252
254
}
You can’t perform that action at this time.
0 commit comments