nodeJs and general extensions..

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

nodeJs and general extensions..

sledorze
got a req of type NodeHttpServerReq

and from facebook tutorial, accessed like this:

req.session.auth. ...

the problem is that session does not exist in NodeHttpServerReq.
I do not want to stress out that it should or not exist but it would be handy to be able to extend it with vars as with functions (supported with extensions 'using' support).


today I can solve that by using an extensions which returns the acces to the field like that:


        public static function _session(req : NodeHttpServerReq) : Session {
                return untyped __js__("req.session");
        }
and writing this:


req.session_().auth. ...

my felling is mixed; it does the job but looks ugly..

Any idea? (and either if session should be supported out of the box..)

Stephane

Reply | Threaded
Open this post in threaded view
|

Re: nodeJs and general extensions..

sledorze
I think the session stuff comes from using expressjs (and additional render etc.. methods on the response are needed) - enought to make me rewrite some other typedef..