Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active May 31, 2019 08:57
Show Gist options
  • Save anchetaWern/de26c8d5f3918f34bdba5698efa4ea7d to your computer and use it in GitHub Desktop.
Save anchetaWern/de26c8d5f3918f34bdba5698efa4ea7d to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: create channel
// server/server.js
app.get("/create-channel", async (req, res) => {
const user_id = req.query.user_id;
const sample_channel = server_side_client.channel('messaging', 'sample-room1', {
name: 'Sample Room 1',
image: 'http://bit.ly/2O35mws',
created_by_id: user_id,
});
const create_channel = await sample_channel.create();
console.log("channel: ", create_channel);
res.send('ok');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment