This git repository provides a quickstart demonstrating how to use Pusher on OpenShift in a Node.js application.
Once you've created the quickstart, you'll need to create a Pusher account and add your authorization information to your Git repository. Making code changes will require you to set a public SSH key, and then to clone your new application Git repository onto your local machine. See the Getting Started page for more steps in this flow.
Step 1. Configure Pusher
- Sign up via http://pusher.com/signup
- Take a note of your application credentials:
- Replace the values in
config.jsonwith the credentials.
Step 2. Deploy your app
git add . git commit -m "my first commit" git push
Step 3. View your app!
https://myapp-<yournamespace>.rhcloud.com and click on the
Trigger Hello World button. This will result in a message being triggered and being broadcast to everybody viewing the page.
(Optional) Step 4. Additional Customizations
You can update the PHP in
server.js to change how the message is triggered.
views/index.ejs to change the channel that is subscribed to, the event which is bound to and how the event is handled.
Pusher documentation: http://pusher.com/docs
Debugging your application: http://pusher.com/docs/debugging
Pusher client and server libraries: http://pusher.com/docs/libraries
Pusher Support on StackOverflow: http://stackoverflow.com/questions/tagged/pusher
Uses nodejs-0.6 with code from https://github.com/pusher/pusher-node-openshift-quickstart