Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active May 31, 2019 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchetaWern/35d02016f3923966d9dfefdbe33ab1e6 to your computer and use it in GitHub Desktop.
Save anchetaWern/35d02016f3923966d9dfefdbe33ab1e6 to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: Initialize Stream Chat Server
// server/server.js
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const StreamChat = require('stream-chat').StreamChat;
require("dotenv").config();
const app = express();
const server_side_client = new StreamChat(
process.env.APP_KEY,
process.env.APP_SECRET
);
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(cors());
app.get("/", async (req, res) => {
res.send('all green!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment