Pages

Friday, August 17, 2012

Node.js integration to Drupal


Node.js integration
===================
This module adds Node.js integration to Drupal.
Setup
=====
1. Install Node.js.

 Installing Node.js and NPM on Ubuntu/Debian

How to Install Node.js

2. Install required Node.js modules with the Node Package Manager (NPM).
Make sure you are in the nodejs module directory - NPM needs the package.json
file that comes with the nodejs module to install the right modules.
cd path/to/your/nodejs/module/directory
npm install
npm uninstall express
npm install express@2.5.9
3. Create a 'nodejs.config.js' file in your nodejs module directory.
Read the 'nodejs.config.js.example' file. A basic configuration can be as simple as:
/**
* 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":"192.168.1.61",
"port":8080,
"key":"/path/to/key/file",
"cert":"/path/to/cert/file",
"resource":"/socket.io",
"publishUrl":"publish",
"serviceKey":"",
"backend":{
"port":80,
"host":"localhost",
"messagePath":"/drupal7/nodejs/message/"},
"clientsCanWriteToChannels":false,
"clientsCanWriteToClients":false,
"extensions":"",
"debug":true,
"transports":["websocket",
"flashsocket",
"htmlfile",
"xhr-polling",
"jsonp-polling"],
"jsMinification":true,
"jsEtag":true,
"logLevel":1};
Set debug to false when you are happy with your setup.
4. Run the node server with the command: node server.js
As long as you have 'debug: true' in your configuration file, you'll see lots of helpful messages.

No comments:

Post a Comment

Thanks for your comment.