Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion "include" functionality?

Received: by 10.150.31.12 with SMTP id e12mr2938150ybe.3.1280239661050;
        Tue, 27 Jul 2010 07:07:41 -0700 (PDT)
X-BeenThere: express-js@googlegroups.com
Received: by 10.151.127.4 with SMTP id e4ls2401541ybn.7.p; Tue, 27 Jul 2010 
	07:07:39 -0700 (PDT)
Received: by 10.151.78.6 with SMTP id f6mr2186309ybl.2.1280239659160;
        Tue, 27 Jul 2010 07:07:39 -0700 (PDT)
Received: by 10.151.78.6 with SMTP id f6mr2186307ybl.2.1280239659083;
        Tue, 27 Jul 2010 07:07:39 -0700 (PDT)
Return-Path: <tjholoway...@gmail.com>
Received: from mail-gx0-f179.google.com (mail-gx0-f179.google.com [209.85.161.179])
        by gmr-mx.google.com with ESMTP id q34si5618172ybn.0.2010.07.27.07.07.38;
        Tue, 27 Jul 2010 07:07:38 -0700 (PDT)
Received-SPF: pass (google.com: domain of tjholoway...@gmail.com designates 209.85.161.179 as permitted sender) client-ip=209.85.161.179;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of tjholoway...@gmail.com designates 209.85.161.179 as permitted sender) smtp.mail=tjholoway...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by gxk26 with SMTP id 26so1698722gxk.10
        for <express-js@googlegroups.com>; Tue, 27 Jul 2010 07:07:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:sender:received
         :in-reply-to:references:date:x-google-sender-auth:message-id:subject
         :from:to:content-type;
        bh=vwCy0GSN6zC8tUJRK4gaR9y1Hza8+bRhi03e1X3nqaY=;
        b=xVZY3TOMgMuXYBpgtxcrJQUZiylHV+cm67+R92bjGEN6Gn4hahYfZUqmBs9KCRw++W
         4SljWgfoqHw9uhQgdGx1zezZFYs2RYMPumuHc8/ov8bePnx1cUxqP7HrwOajG+Ddu7dB
         bWw3yVksXwnS5N/FW21FQsIkdph8MKBjDAlZs=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:sender:in-reply-to:references:date
         :x-google-sender-auth:message-id:subject:from:to:content-type;
        b=LnnqyT1NjVL1DGGjZWbBCBoo7XKFeYwTilu/K+HuyJs6bda+BdjtKnTQ9lIsRym21W
         jaoJLHB4tY8U9P2njo3k7EuFvJ9jK0heNQ/fNJER0PkZhwgRE9zgTt1yjlAtQsRpVX2Z
         iyT90pkjmreCoYsNk9wOq/VuH8CkkK8L4NY/U=
MIME-Version: 1.0
Received: by 10.151.4.9 with SMTP id g9mr10817054ybi.301.1280239657719; Tue, 
	27 Jul 2010 07:07:37 -0700 (PDT)
Sender: tjholoway...@gmail.com
Received: by 10.231.30.72 with HTTP; Tue, 27 Jul 2010 07:07:37 -0700 (PDT)
In-Reply-To: <AANLkTikH8g9oaB1Atr44Hj97Xpseb1G3a0B6jRc7n...@mail.gmail.com>
References: <AANLkTi=6ZsnWoG0kwekKGvNx37EOqvntd2H2Cx6P+...@mail.gmail.com>
	<AANLkTikyPTFUQDR=9PCTRYE8yvsEJbW9hCjbYODys...@mail.gmail.com>
	<AANLkTimc=U3enX0w9u5wz_Pd11uUMTei=xsnh4UHG...@mail.gmail.com>
	<AANLkTimArWEjNnTZQw1Ug=LBkrtOOK0EPGkWp0-_a...@mail.gmail.com>
	<AANLkTi=xP4VM_6vxPasj9dR5=y=TN28gZkhLnitxn...@mail.gmail.com>
	<AANLkTinreyd1cdHuHp39cNPqKzA0g7bs4FTAd+Bdp...@mail.gmail.com>
	<AANLkTikJKGmXVLWLWTmcUKPcBXA-3s2dXLcYGEfDn...@mail.gmail.com>
	<E4ECF798-2667-4090-AA6E-39029556B...@gmail.com>
	<AANLkTikSYm-DSbYFT_As3_UFS+b4CsLDZHzpdUgS6...@mail.gmail.com>
	<AANLkTikH8g9oaB1Atr44Hj97Xpseb1G3a0B6jRc7n...@mail.gmail.com>
Date: Tue, 27 Jul 2010 07:07:37 -0700
Message-ID: <AANLkTinx3Fv4djcXm35LOgeEdPfS6Nq_-FHuuo7Yc...@mail.gmail.com>
Subject: Re: "include" functionality?
From: "vision media [ Tj Holowaychuk ]" <t...@vision-media.ca>
To: express-js@googlegroups.com
Content-Type: multipart/alternative; boundary=000e0cd23f14069a4c048c5f0671

--000e0cd23f14069a4c048c5f0671
Content-Type: text/plain; charset=ISO-8859-1

hell you might even want to module.exports = function(app){ app.get(...) }

and then require('./foobar')(app)

explicitly passing your app instance

On Tue, Jul 27, 2010 at 7:06 AM, vision media [ Tj Holowaychuk ] <
t...@vision-media.ca> wrote:

> The example is not magic at all if your used to node modules, I would not
> call
> it elegant but the point is nothing is imposed, any way you choose to get
> your
> app from one module to another is fine :)
>
>
> On Tue, Jul 27, 2010 at 5:47 AM, Kadir Pekel <kadirpe...@gmail.com> wrote:
>
>> +1 for Hecmann's
>>
>> My humble opinion is doing it with less magic for more understandable and
>> acceptable structure.
>>
>> thnks.
>>
>>
>> On Tue, Jul 27, 2010 at 3:25 PM, Aaron Heckmann <aaron.heckm...@gmail.com
>> > wrote:
>>
>>> The only other option I see is to export a method from your child module
>>> that accepts an app instance which you then use to wire up routes - and that
>>> is far less elegant.
>>>
>>> On Jul 26, 2010, at 11:14 PM, "Jeffrey 'jf' Lim" <jfs.wo...@gmail.com>
>>> wrote:
>>>
>>> > yeah thanks, guys! this is precisely what I'm looking for (although
>>> > yes :), a more elegant way would be great... But hey, it works!!!) - a
>>> > way to be able to refer to 'app' in require-d files... And Kadir, I am
>>> > subscribed. I just missed out on that thread. Thanks for pointing it
>>> > out!!!
>>> >
>>> > -jf
>>> >
>>> >
>>> >
>>> > On Tue, Jul 27, 2010 at 12:04 AM, vision media [ Tj Holowaychuk ]
>>> > <t...@vision-media.ca> wrote:
>>> >> The parent module reference is a bit weird I know, but it works just
>>> fine. I
>>> >> would love
>>> >> suggestions for a clear way to do this, but you cant just simply
>>> >> require('./app') or similar
>>> >> because you will cause a cyclic require and segfault :) this is the
>>> best
>>> >> approach I have come
>>> >> up with
>>> >>
>>> >> On Mon, Jul 26, 2010 at 6:18 AM, Kadir Pekel <kadirpe...@gmail.com>
>>> wrote:
>>> >>>
>>> >>> Hi Jeffrey,
>>> >>>
>>> >>> It was also discussed yesterday.
>>> >>>
>>> >>>
>>> >>>
>>> http://groups.google.com/group/express-js/browse_thread/thread/80f21aba4cb54e58#
>>> >>>
>>> >>> You'd better subscribe to group if you are really interested in :)
>>> >>>
>>> >>> Good luck with Express.
>>> >>>
>>> >>> On Mon, Jul 26, 2010 at 3:19 PM, Aaron Heckmann <
>>> aaron.heckm...@gmail.com>
>>> >>> wrote:
>>> >>>>
>>> >>>> I believe what you're looking for is in the blog example:
>>> >>>>
>>> http://github.com/visionmedia/express/blob/master/examples/blog/app.js
>>> >>>> In app.js, the server instance is assigned to module.exports so that
>>> >>>> child modules have access to "app" (the server) as well.
>>> >>>> Now take a peek at contact.js
>>> >>>>
>>> >>>>
>>> http://github.com/visionmedia/express/blob/master/examples/blog/contact.js
>>> >>>> Here you see how to set up routes in child modules by accessing
>>> >>>> "module.parent.exports" which is the "app" in app.js.
>>> >>>>
>>> >>>> On Mon, Jul 26, 2010 at 6:33 AM, Sam Millman <smill...@nhbs.co.uk>
>>> wrote:
>>> >>>>>
>>> >>>>> require should work both ways since it just includes the page code
>>> into
>>> >>>>> the current document then it is upto you to instantiate the object
>>> yourself.
>>> >>>>>
>>> >>>>> On 26 July 2010 11:29, Sam Millman <smill...@nhbs.co.uk> wrote:
>>> >>>>>>
>>> >>>>>> you mean:
>>> >>>>>> require("sys");
>>> >>>>>> or:
>>> >>>>>> require("./mongod/somecheeseyclassthatIwantincluded")
>>> >>>>>> In turn this allows you to propogate a class. Is this what you
>>> mean or
>>> >>>>>> do you meant the php include where it acts as a part of the file?
>>> >>>>>> so:
>>> >>>>>> require("sys") would mean the code of that file is placed into the
>>> >>>>>> current document allowing the code to be manipulated as if it
>>> wasnt in a
>>> >>>>>> different file?
>>> >>>>>> On 26 July 2010 09:54, Jeffrey 'jf' Lim <jfs.wo...@gmail.com>
>>> wrote:
>>> >>>>>>>
>>> >>>>>>> Anybody wondered about this? I come from a sinatra background :),
>>> and
>>> >>>>>>> I very much like the ability to be able to arbitrarily split off
>>> >>>>>>> related functionality/code into different files (eg. I want to
>>> split
>>> >>>>>>> off the "app.get('/user/xxx', ...)" stuff into another file, say
>>> >>>>>>> users.js). In sinatra, you could do this with a 'require'.
>>> >>>>>>> Unfortunately, this doesnt seem possible with node/expressjs. Or
>>> is
>>> >>>>>>> there something i'm missing? Does anybody miss/want this
>>> >>>>>>> functionality?
>>> >>>>>>>
>>> >>>>>>> -jf
>>> >>>>>>>
>>> >>>>>>> --
>>> >>>>>>> "Every nonfree program has a lord, a master --
>>> >>>>>>> and if you use the program, he is your master."
>>> >>>>>>>     --Richard Stallman
>>> >>>>>>>
>>> >>>>>>> "It's so hard to write a graphics driver that open-sourcing it
>>> would
>>> >>>>>>> not help."
>>> >>>>>>>     -- Andrew Fear, Software Product Manager, NVIDIA Corporation
>>> >>>>>>> http://kerneltrap.org/node/7228
>>> >>>>>>>
>>> >>>>>>> --
>>> >>>>>>> You received this message because you are subscribed to the
>>> Google
>>> >>>>>>> Groups "Express" group.
>>> >>>>>>> To post to this group, send email to express-js@googlegroups.com
>>> .
>>> >>>>>>> To unsubscribe from this group, send email to
>>> >>>>>>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> >>>>>>> For more options, visit this group at
>>> >>>>>>> http://groups.google.com/group/express-js?hl=en.
>>> >>>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>>
>>> >>>>>> --
>>> >>>>>> Bow Chicka Bow Wow
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> --
>>> >>>>> Bow Chicka Bow Wow
>>> >>>>>
>>> >>>>> --
>>> >>>>> You received this message because you are subscribed to the Google
>>> >>>>> Groups "Express" group.
>>> >>>>> To post to this group, send email to express-js@googlegroups.com.
>>> >>>>> To unsubscribe from this group, send email to
>>> >>>>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> >>>>> For more options, visit this group at
>>> >>>>> http://groups.google.com/group/express-js?hl=en.
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> --
>>> >>>> Aaron
>>> >>>> http://clickdummy.net
>>> >>>>
>>> >>>> --
>>> >>>> You received this message because you are subscribed to the Google
>>> Groups
>>> >>>> "Express" group.
>>> >>>> To post to this group, send email to express-js@googlegroups.com.
>>> >>>> To unsubscribe from this group, send email to
>>> >>>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> >>>> For more options, visit this group at
>>> >>>> http://groups.google.com/group/express-js?hl=en.
>>> >>>
>>> >>>
>>> >>>
>>> >>> --
>>> >>> Kadir Pekel
>>> >>>
>>> >>> --
>>> >>> You received this message because you are subscribed to the Google
>>> Groups
>>> >>> "Express" group.
>>> >>> To post to this group, send email to express-js@googlegroups.com.
>>> >>> To unsubscribe from this group, send email to
>>> >>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> >>> For more options, visit this group at
>>> >>> http://groups.google.com/group/express-js?hl=en.
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> Tj Holowaychuk
>>> >> Vision Media
>>> >> President & Creative Lead
>>> >>
>>> >> --
>>> >> You received this message because you are subscribed to the Google
>>> Groups
>>> >> "Express" group.
>>> >> To post to this group, send email to express-js@googlegroups.com.
>>> >> To unsubscribe from this group, send email to
>>> >> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> >> For more options, visit this group at
>>> >> http://groups.google.com/group/express-js?hl=en.
>>> >>
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "Express" group.
>>> > To post to this group, send email to express-js@googlegroups.com.
>>> > To unsubscribe from this group, send email to
>>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> > For more options, visit this group at
>>> http://groups.google.com/group/express-js?hl=en.
>>> >
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Express" group.
>>> To post to this group, send email to express-js@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/express-js?hl=en.
>>>
>>>
>>
>>
>> --
>>
>> kadir.
>> -- http://twitter.com/kadirpekel
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Express" group.
>> To post to this group, send email to express-js@googlegroups.com.
>> To unsubscribe from this group, send email to
>> express-js+unsubscribe@googlegroups.com<express-js%2Bunsubscribe@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/express-js?hl=en.
>>
>
>
>
> --
> Tj Holowaychuk
> Vision Media
> President & Creative Lead
>



-- 
Tj Holowaychuk
Vision Media
President & Creative Lead

--000e0cd23f14069a4c048c5f0671
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

hell you might even want to module.exports =3D function(app){ app.get(...) =
}<div><br></div><div>and then require(&#39;./foobar&#39;)(app)</div><div><b=
r></div><div>explicitly passing your app instance</div><div><br><div class=
=3D"gmail_quote">
On Tue, Jul 27, 2010 at 7:06 AM, vision media [ Tj Holowaychuk ] <span dir=
=3D"ltr">&lt;<a href=3D"mailto:t...@vision-media.ca">t...@vision-media.ca</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
The example is not magic at all if your used to node modules, I would not c=
all<div>it=A0elegant=A0but the point is nothing is imposed, any way you cho=
ose to get your</div><div>app from one module to another is fine :)<div><di=
v>
</div><div class=3D"h5"><br><br><div class=3D"gmail_quote">
On Tue, Jul 27, 2010 at 5:47 AM, Kadir Pekel <span dir=3D"ltr">&lt;<a href=
=3D"mailto:kadirpe...@gmail.com" target=3D"_blank">kadirpe...@gmail.com</a>=
&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0=
 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

+1 for Hecmann&#39;s<br><br>My humble opinion is doing it with less magic f=
or more understandable and acceptable structure.<br><br>thnks.<div><div></d=
iv><div><br><br><div class=3D"gmail_quote">On Tue, Jul 27, 2010 at 3:25 PM,=
 Aaron Heckmann <span dir=3D"ltr">&lt;<a href=3D"mailto:aaron.heckmann@gmai=
l.com" target=3D"_blank">aaron.heckm...@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class=3D"gmail_quote" style=3D"margin:0pt 0pt 0pt 0.8ex;border-=
left:1px solid rgb(204, 204, 204);padding-left:1ex">The only other option I=
 see is to export a method from your child module that accepts an app insta=
nce which you then use to wire up routes - and that is far less elegant.<br=
>



<div><div></div><div><br>
On Jul 26, 2010, at 11:14 PM, &quot;Jeffrey &#39;jf&#39; Lim&quot; &lt;<a h=
ref=3D"mailto:jfs.wo...@gmail.com" target=3D"_blank">jfs.wo...@gmail.com</a=
>&gt; wrote:<br>
<br>
&gt; yeah thanks, guys! this is precisely what I&#39;m looking for (althoug=
h<br>
&gt; yes :), a more elegant way would be great... But hey, it works!!!) - a=
<br>
&gt; way to be able to refer to &#39;app&#39; in require-d files... And Kad=
ir, I am<br>
&gt; subscribed. I just missed out on that thread. Thanks for pointing it<b=
r>
&gt; out!!!<br>
&gt;<br>
&gt; -jf<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Jul 27, 2010 at 12:04 AM, vision media [ Tj Holowaychuk ]<br>
&gt; &lt;<a href=3D"mailto:t...@vision-media.ca" target=3D"_blank">tj@vision-=
media.ca</a>&gt; wrote:<br>
&gt;&gt; The parent module reference is a bit weird I know, but it works ju=
st fine. I<br>
&gt;&gt; would love<br>
&gt;&gt; suggestions for a clear way to do this, but you cant just simply<b=
r>
&gt;&gt; require(&#39;./app&#39;) or similar<br>
&gt;&gt; because you will cause a cyclic require and segfault :) this is th=
e best<br>
&gt;&gt; approach I have come<br>
&gt;&gt; up with<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jul 26, 2010 at 6:18 AM, Kadir Pekel &lt;<a href=3D"mailto=
:kadirpe...@gmail.com" target=3D"_blank">kadirpe...@gmail.com</a>&gt; wrote=
:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi Jeffrey,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; It was also discussed yesterday.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; <a href=3D"http://groups.google.com/group/express-js/browse_th=
read/thread/80f21aba4cb54e58#" target=3D"_blank">http://groups.google.com/g=
roup/express-js/browse_thread/thread/80f21aba4cb54e58#</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; You&#39;d better subscribe to group if you are really interest=
ed in :)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Good luck with Express.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Mon, Jul 26, 2010 at 3:19 PM, Aaron Heckmann &lt;<a href=3D=
"mailto:aaron.heckm...@gmail.com" target=3D"_blank">aaron.heckm...@gmail.co=
m</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; I believe what you&#39;re looking for is in the blog examp=
le:<br>
&gt;&gt;&gt;&gt; <a href=3D"http://github.com/visionmedia/express/blob/mast=
er/examples/blog/app.js" target=3D"_blank">http://github.com/visionmedia/ex=
press/blob/master/examples/blog/app.js</a><br>
&gt;&gt;&gt;&gt; In app.js, the server instance is assigned to module.expor=
ts so that<br>
&gt;&gt;&gt;&gt; child modules have access to &quot;app&quot; (the server) =
as well.<br>
&gt;&gt;&gt;&gt; Now take a peek at contact.js<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; <a href=3D"http://github.com/visionmedia/express/blob/mast=
er/examples/blog/contact.js" target=3D"_blank">http://github.com/visionmedi=
a/express/blob/master/examples/blog/contact.js</a><br>
&gt;&gt;&gt;&gt; Here you see how to set up routes in child modules by acce=
ssing<br>
&gt;&gt;&gt;&gt; &quot;module.parent.exports&quot; which is the &quot;app&q=
uot; in app.js.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; On Mon, Jul 26, 2010 at 6:33 AM, Sam Millman &lt;<a href=
=3D"mailto:smill...@nhbs.co.uk" target=3D"_blank">smill...@nhbs.co.uk</a>&g=
t; wrote:<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; require should work both ways since it just includes t=
he page code into<br>
&gt;&gt;&gt;&gt;&gt; the current document then it is upto you to instantiat=
e the object yourself.<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; On 26 July 2010 11:29, Sam Millman &lt;<a href=3D"mail=
to:smill...@nhbs.co.uk" target=3D"_blank">smill...@nhbs.co.uk</a>&gt; wrote=
:<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; you mean:<br>
&gt;&gt;&gt;&gt;&gt;&gt; require(&quot;sys&quot;);<br>
&gt;&gt;&gt;&gt;&gt;&gt; or:<br>
&gt;&gt;&gt;&gt;&gt;&gt; require(&quot;./mongod/somecheeseyclassthatIwantin=
cluded&quot;)<br>
&gt;&gt;&gt;&gt;&gt;&gt; In turn this allows you to propogate a class. Is t=
his what you mean or<br>
&gt;&gt;&gt;&gt;&gt;&gt; do you meant the php include where it acts as a pa=
rt of the file?<br>
&gt;&gt;&gt;&gt;&gt;&gt; so:<br>
&gt;&gt;&gt;&gt;&gt;&gt; require(&quot;sys&quot;) would mean the code of th=
at file is placed into the<br>
&gt;&gt;&gt;&gt;&gt;&gt; current document allowing the code to be manipulat=
ed as if it wasnt in a<br>
&gt;&gt;&gt;&gt;&gt;&gt; different file?<br>
&gt;&gt;&gt;&gt;&gt;&gt; On 26 July 2010 09:54, Jeffrey &#39;jf&#39; Lim &l=
t;<a href=3D"mailto:jfs.wo...@gmail.com" target=3D"_blank">jfs.world@gmail.=
com</a>&gt; wrote:<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Anybody wondered about this? I come from a sin=
atra background :), and<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; I very much like the ability to be able to arb=
itrarily split off<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; related functionality/code into different file=
s (eg. I want to split<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; off the &quot;app.get(&#39;/user/xxx&#39;, ...=
)&quot; stuff into another file, say<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; users.js). In sinatra, you could do this with =
a &#39;require&#39;.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Unfortunately, this doesnt seem possible with =
node/expressjs. Or is<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; there something i&#39;m missing? Does anybody =
miss/want this<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; functionality?<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; -jf<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &quot;Every nonfree program has a lord, a mast=
er --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; and if you use the program, he is your master.=
&quot;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; =A0 =A0 --Richard Stallman<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; &quot;It&#39;s so hard to write a graphics dri=
ver that open-sourcing it would<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; not help.&quot;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; =A0 =A0 -- Andrew Fear, Software Product Manag=
er, NVIDIA Corporation<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href=3D"http://kerneltrap.org/node/7228" ta=
rget=3D"_blank">http://kerneltrap.org/node/7228</a><br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; You received this message because you are subs=
cribed to the Google<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; Groups &quot;Express&quot; group.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; To post to this group, send email to <a href=
=3D"mailto:express-js@googlegroups.com" target=3D"_blank">express-js@google=
groups.com</a>.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group, send email to<=
br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href=3D"mailto:express-js%2Bunsubscribe@goo=
glegroups.com" target=3D"_blank">express-js+unsubscribe@googlegroups.com</a=
>.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; For more options, visit this group at<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt; <a href=3D"http://groups.google.com/group/expr=
ess-js?hl=3Den" target=3D"_blank">http://groups.google.com/group/express-js=
?hl=3Den</a>.<br>
&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt;&gt; Bow Chicka Bow Wow<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; Bow Chicka Bow Wow<br>
&gt;&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt;&gt; You received this message because you are subscribed t=
o the Google<br>
&gt;&gt;&gt;&gt;&gt; Groups &quot;Express&quot; group.<br>
&gt;&gt;&gt;&gt;&gt; To post to this group, send email to <a href=3D"mailto=
:express-js@googlegroups.com" target=3D"_blank">express-js@googlegroups.com=
</a>.<br>
&gt;&gt;&gt;&gt;&gt; To unsubscribe from this group, send email to<br>
&gt;&gt;&gt;&gt;&gt; <a href=3D"mailto:express-js%2Bunsubscribe@googlegroup=
s.com" target=3D"_blank">express-js+unsubscribe@googlegroups.com</a>.<br>
&gt;&gt;&gt;&gt;&gt; For more options, visit this group at<br>
&gt;&gt;&gt;&gt;&gt; <a href=3D"http://groups.google.com/group/express-js?h=
l=3Den" target=3D"_blank">http://groups.google.com/group/express-js?hl=3Den=
</a>.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; Aaron<br>
&gt;&gt;&gt;&gt; <a href=3D"http://clickdummy.net" target=3D"_blank">http:/=
/clickdummy.net</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; --<br>
&gt;&gt;&gt;&gt; You received this message because you are subscribed to th=
e Google Groups<br>
&gt;&gt;&gt;&gt; &quot;Express&quot; group.<br>
&gt;&gt;&gt;&gt; To post to this group, send email to <a href=3D"mailto:exp=
ress-js@googlegroups.com" target=3D"_blank">express-js@googlegroups.com</a>=
.<br>
&gt;&gt;&gt;&gt; To unsubscribe from this group, send email to<br>
&gt;&gt;&gt;&gt; <a href=3D"mailto:express-js%2Bunsubscr...@googlegroups.co=
m" target=3D"_blank">express-js+unsubscribe@googlegroups.com</a>.<br>
&gt;&gt;&gt;&gt; For more options, visit this group at<br>
&gt;&gt;&gt;&gt; <a href=3D"http://groups.google.com/group/express-js?hl=3D=
en" target=3D"_blank">http://groups.google.com/group/express-js?hl=3Den</a>=
.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; Kadir Pekel<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; You received this message because you are subscribed to the Go=
ogle Groups<br>
&gt;&gt;&gt; &quot;Express&quot; group.<br>
&gt;&gt;&gt; To post to this group, send email to <a href=3D"mailto:express=
-js@googlegroups.com" target=3D"_blank">express-js@googlegroups.com</a>.<br=
>
&gt;&gt;&gt; To unsubscribe from this group, send email to<br>
&gt;&gt;&gt; <a href=3D"mailto:express-js%2Bunsubscribe@googlegroups.com" t=
arget=3D"_blank">express-js+unsubscribe@googlegroups.com</a>.<br>
&gt;&gt;&gt; For more options, visit this group at<br>
&gt;&gt;&gt; <a href=3D"http://groups.google.com/group/express-js?hl=3Den" =
target=3D"_blank">http://groups.google.com/group/express-js?hl=3Den</a>.<br=
>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Tj Holowaychuk<br>
&gt;&gt; Vision Media<br>
&gt;&gt; President &amp; Creative Lead<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; You received this message because you are subscribed to the Google=
 Groups<br>
&gt;&gt; &quot;Express&quot; group.<br>
&gt;&gt; To post to this group, send email to <a href=3D"mailto:express-js@=
googlegroups.com" target=3D"_blank">express-js@googlegroups.com</a>.<br>
&gt;&gt; To unsubscribe from this group, send email to<br>
&gt;&gt; <a href=3D"mailto:express-js%2Bunsubscribe@googlegroups.com" targe=
t=3D"_blank">express-js+unsubscribe@googlegroups.com</a>.<br>
&gt;&gt; For more options, visit this group at<br>
&gt;&gt; <a href=3D"http://groups.google.com/group/express-js?hl=3Den" targ=
et=3D"_blank">http://groups.google.com/group/express-js?hl=3Den</a>.<br>
&gt;&gt;<br>
&gt;<br>
&gt; --<br>
&gt; You received this message because you are subscribed to the Google Gro=
ups &quot;Express&quot; group.<br>
&gt; To post to this group, send email to <a href=3D"mailto:express-js@goog=
legroups.com" target=3D"_blank">express-js@googlegroups.com</a>.<br>
&gt; To unsubscribe from this group, send email to <a href=3D"mailto:expres=
s-js%2Bunsubscribe@googlegroups.com" target=3D"_blank">express-js+unsubscri=
be@googlegroups.com</a>.<br>
&gt; For more options, visit this group at <a href=3D"http://groups.google.=
com/group/express-js?hl=3Den" target=3D"_blank">http://groups.google.com/gr=
oup/express-js?hl=3Den</a>.<br>
&gt;<br>
<br>
</div></div>--<br>
<div><div></div><div>You received this message because you are subscribed t=
o the Google Groups &quot;Express&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:express-js@googlegro=
ups.com" target=3D"_blank">express-js@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:express-js%=
2Bunsubscribe@googlegroups.com" target=3D"_blank">express-js+unsubscribe@go=
oglegroups.com</a>.<br>
For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/express-js?hl=3Den" target=3D"_blank">http://groups.google.com/group/e=
xpress-js?hl=3Den</a>.<br>
<br>
</div></div></blockquote></div><br><br clear=3D"all"><br></div></div>-- <br=
><br>kadir.<br>-- <a href=3D"http://twitter.com/kadirpekel" target=3D"_blan=
k">http://twitter.com/kadirpekel</a><br><font color=3D"#888888"><br>

<p></p>

-- <br></font><div><div></div><div>
You received this message because you are subscribed to the Google Groups &=
quot;Express&quot; group.<br>
To post to this group, send email to <a href=3D"mailto:express-js@googlegro=
ups.com" target=3D"_blank">express-js@googlegroups.com</a>.<br>
To unsubscribe from this group, send email to <a href=3D"mailto:express-js%=
2Bunsubscribe@googlegroups.com" target=3D"_blank">express-js+unsubscribe@go=
oglegroups.com</a>.<br>

For more options, visit this group at <a href=3D"http://groups.google.com/g=
roup/express-js?hl=3Den" target=3D"_blank">http://groups.google.com/group/e=
xpress-js?hl=3Den</a>.<br>


</div></div></blockquote></div><br><br clear=3D"all"><br></div></div>-- <br=
><div class=3D"im">Tj Holowaychuk<br>Vision Media<br>President &amp; Creati=
ve Lead<br>
</div></div>
</blockquote></div><br><br clear=3D"all"><br>-- <br>Tj Holowaychuk<br>Visio=
n Media<br>President &amp; Creative Lead<br>
</div>

--000e0cd23f14069a4c048c5f0671--