Skip to content

Update to hxNode

January 22, 2010

Updated API for node .js 0.125 and fixed some inconsistencies also addedServlet.hx which demonstrates the use of Node Http, and can be used like this …

 public static function
  makeGetUsersServlet() {
    var users = new JSONP(GETUSERS,function(req:IRequest,res:String->Void) {
        session = field(req.validated,SESSID),
        page = Std.parseInt(field(req.params,PAGE)),
        rows = Std.parseInt(field(req.params,ROWS));

        if (Accounts.roleTrumps(MANAGER,session.role)) {
          Accounts.usersByPage(page,rows).addCallback(function(users) {
        } else {

create your servlets then fire up the server, e.g.

new HttpServer(,accountServer.port,”Accounts 0.1″);

I like to use lots of enums for param and servlet names so i can guarantee i get the spelling right in client haxe too,
this may not be to everyone’s taste – the nice thing is it’s small and easy to change.


From → haxe, javascript, node.js

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: