I assume you know
1. how to setup drupal on your local machine
2. how to use drush
3. npm installed, if not refer installing npm
Step 1.
Go to root of your drupal project and run following commands
drush dl nodejs
drush en -y nodejs nodejs_config nodejs_notify nodejs_actions nodejs_subscribe
Here we are installing necessary modules.
Step 2.
Nodejs server required . To download run following commands
git clone https://github.com/beejeebus/drupal-nodejs.git
cd /var/www/drupal-nodejs
npm install
cp nodejs.config.js.example nodejs.config.js
open the "nodejs.config.js" file in editor.
Step 3.
Open following url in browser.
YOUR_VIRTUAL_HOST/admin/config/nodejs/js
This will open configuration builder UI. It will look like
* This configuration file was built using the 'Node.js server configuration builder'.
* For a more fully commented example see the file nodejs.config.js.example in the root of this module
*/
backendSettings = {
"scheme":"http",
"host":"localhost",
"port":9001,
"key":"/path/to/key/file",
"cert":"/path/to/cert/file",
"resource":"/socket.io",
"publishUrl":"publish",
"serviceKey":"murli800",
"backend":{
"port":80,
"host":"quora.api",
"messagePath":"/nodejs/message"},
"clientsCanWriteToChannels":false,
"clientsCanWriteToClients":false,
"extensions":"",
"debug":true,
"transports":["websocket",
"polling"],
"jsMinification":true,
"jsEtag":true,
"logLevel":1};
Copy the configuration and replace all content in "nodejs.config.js" , which you opened in Step 2.
Step 4.
Run following commands
cd /var/www/drupal-nodejs
node app.js
This will start the server in foreground.Now open following url to send broadcast message to all user.
YOUR_VIRTUAL_HOST/admin/config/nodejs/nodejs_notify/broadcast
This will open UI likeNow login with any user in other browser so that you can see notification .Submit the above form from the browser in which admin is logged in. If the setup is fine , then you will see a pop like
I hope this would help :)
This is such a nice post which you shared here. it really helps me out. Keep sharing posts like these.
ReplyDeleteHire Drupal Developers |
Drupal Development Company