I'm using it.
Here my directory structure (for development):
/home/myprojects/nodeserver
/home/myprojects/httpdocs
/home/myprojects/httpdocs/qooxdoo-1.5.sdk
/home/myprojects/httpdocs/source
/home/myprojects/httpdocs/build
In nodeserver directory i have server.js, which is the node server. Code
below :
--------- begin of server.js
#!/usr/bin/env node
var connect = require('connect'),
sesame = require('sesame'),
MemoryStore = connect.session.MemoryStore,
crypto = require('crypto'),
fs = require('fs'),
formidable = require('formidable'),
sys = require('sys'),
querystring = require('querystring');
var server=connect.createServer(
sesame(),
connect.bodyParser(),
connect.router(app),
connect.static(__dirname + '/../httpdocs',{maxAge:0}),
connect.errorHandler({ dumpExceptions: true, showStack: true })
);
var sendExpire=function(res) {
/* my own function to send Expires header for static js files (qooxdoo)
*/
/* so when you often reload your qooxdoo app, it's more speed */
var o=new Date();
var nd=new Date(o.getTime()+(60*60*1000));
res.setHeader('Expires', nd.toUTCString());
}
function app(app) {
app.get('/qoo*',function(req,res,next) {
/* send Expires header for qooxdoo dsk files */
sendExpire(res);
next();
});
/* json webservice when url /userCheckSession is requested */
app.post('/userCheckSession',function(request,response) { ... do
something ..});
}
server.listen(80);
----------------- end of server.js
To launch the server, i go to /home/myprojects/nodeserver and just type
./server.js in a screen
Of course you need to install some modules first. Install "npm" tool first
using
curl http://npmjs.org/install.sh | sh
And then install all necessary modules :
npm install connect
npm install formidable
... etc
That's all folks ;)
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/How-to-get-started-with-qxoo-and-Node-js-tp6799982p6800096.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
http://p.sf.net/sfu/rim-devcon-copy2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel