https://github.com/darshankumar89/pusherchat
https://github.com/darshankumar89/pusherchat
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/darshankumar89/pusherchat
- Owner: DarshanKumar89
- Created: 2014-08-01T06:15:08.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-01T06:22:44.000Z (almost 12 years ago)
- Last Synced: 2024-12-31T19:21:31.951Z (over 1 year ago)
- Language: CSS
- Size: 285 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Realtime Chat Widget using Pusher
This sample shows how to create a Realtime Chat Widget with a PHP, Ruby or Node.js backend.
## Demo
Here is a [live version of the chat widget in action](http://pusher.com/tutorials/realtime_chat_widget).
## Tutorial
We've put together a [tutorial on how to get up and running with the widget](http://pusher.com/tutorials/realtime_chat_widget).
## src
### /nodejs
The server code required to run the example using [Node.js](http://nodejs.org/).
The `src/chat.html` file will need to be updated so that the `PusherChatWidget` talks to the Node app. This means providing a `chatEndPoint` setting to point to `/chat` as follows:
var pusher = new Pusher("CHANGE_KEY")
var chatWidget = new PusherChatWidget(pusher, {
appendTo: "#pusher_chat_widget",
chatEndPoint: "/chat"
});
You can then get started by:
cd src/nodejs
npm install
node app.js
And navigating to http://localhost:4567 to see the side-by-side example or http://localhost:4567/chat.html to see the standalone example.
### /php
The server code required to use the widget with a PHP back-end. The `src/chat.html` file is set up to use the PHP back-end.
### /ruby-sinatra
The server code required to run the example using [Sinatra](http://www.sinatrarb.com/).
The `src/chat.html` file will need to be updated so that the `PusherChatWidget` talks to the sinatra app. This means providing a `chatEndPoint` setting to point to `/chat` as follows:
var pusher = new Pusher("CHANGE_KEY")
var chatWidget = new PusherChatWidget(pusher, {
appendTo: "#pusher_chat_widget",
chatEndPoint: "/chat"
});
You can then get started by:
cd src/ruby-sinatra
bundle install
bundle exec ruby -rubygems chat.rb
And navigating to http://localhost:4567/ to see the side-by-side example or http://localhost:4567/chat.html to see the standalone example.