GithubHelp home page GithubHelp logo

pusher / build-a-slack-clone-with-react-and-pusher-chatkit Goto Github PK

View Code? Open in Web Editor NEW
235.0 235.0 68.0 2.39 MB

In this tutorial, you'll learn how to build a chat app with React, complete with typing indicators, online status, and more.

Home Page: https://pusher.com/chatkit

HTML 22.22% JavaScript 58.91% CSS 18.87%
chat chatkit react

build-a-slack-clone-with-react-and-pusher-chatkit's Issues

Why git checkout tags/template?

How come you chose this approach? It puts you in an usual git place. I don't believe many people will have used this before too much. Could we get away without?

image

error establishing presence subscription:

I'm getting the below error while trying to authenticate the user. I have searched for the solutions and changed the code according to that but nothing seems to be working. A quick help would be much appreciated.

image

And here is my code,

const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const Chatkit = require('@pusher/chatkit-server')

const app = express()

const chatkit = new Chatkit.default({

instanceLocator: 'Pusher Locator Key',
key:'Pusher Secret Key'

})

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(cors())

app.post('/users', ( req, res ) => {

const { username } = req.body

chatkit.createUser({
name: username,
id: username
})
.then(() => res.sendStatus(201))
.catch(error => {
if(error.error_type === 'services/chatkit/user_already_exists'){
res.sendStatus(200)
}
else{
res.status(error.statusCode).json(error)
}
})
})

app.post('/authenticate', ( req, res ) => {

const { grant_type } = req.body
res.json(chatkit.authenticate({ grant_type, userId : req.query.user_id }))

})

const PORT = 3001
app.listen(PORT, err => {
if (err) {
console.error(err)
} else {
console.log(Running on port ${PORT})
}
})

Thanks in advance..!

Content Security Policy error

When I start the developpement server on "localhost:3001" I get this error in my debugger :

Content Security Policy: Les paramètres de la page ont empêché le chargement d’une ressource à self (« script-src »). Source: ;(function installGlobalHook(window)

on the page I see
Cannot GET /

how resolve that ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.