Received: by 10.59.7.167 with SMTP id dd7mr3843906ved.26.1347155044727; Sat, 08 Sep 2012 18:44:04 -0700 (PDT) X-BeenThere: flatironjs@googlegroups.com Received: by 10.220.223.69 with SMTP id ij5ls548359vcb.6.gmail; Sat, 08 Sep 2012 18:44:04 -0700 (PDT) Received: by 10.52.90.129 with SMTP id bw1mr1425702vdb.13.1347155044368; Sat, 08 Sep 2012 18:44:04 -0700 (PDT) Date: Sat, 8 Sep 2012 18:44:04 -0700 (PDT) From: shawn wilson To: flatironjs@googlegroups.com Message-Id: <6da9d21c-9b0e-4479-a2d5-52d7f4a8fd5c@googlegroups.com> In-Reply-To: References: <576d68e1-989a-40f3-90d8-22ea2d2dbb7e@googlegroups.com> Subject: Re: [flatironjs] defining routes as a structure MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_240_8908661.1347155044186" ------=_Part_240_8908661.1347155044186 Content-Type: multipart/alternative; boundary="----=_Part_241_8006457.1347155044187" ------=_Part_241_8006457.1347155044187 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit yes, i just found this: https://github.com/flatiron/flatiron/issues/19 it still doesn't "work" - i curl and it just sits there, but it isn't crashing ... so, do i still need {"get": function() { ..... res.end(); } } ? i'm going back to the docs for now... On Saturday, September 8, 2012 9:35:44 PM UTC-4, Marak Squires wrote: > > app.router is a Director.router instance. You can't override it like that. > Maybe you can try setting app.router.routes, but I don't think that would > work either. > > There should be an API method for adding routes as JSON. Should be in the > README as "mount" > > mount(routes, path) > > - routes {object}: Partial routing table to insert into this instance. > - path {string|Regexp}: Path within the Routing Table to insert the > routes into. > > Inserts the partial Routing Table > , routes, into the Routing Table for this Router instance at the > specified path. > > On Sat, Sep 8, 2012 at 6:29 PM, shawn wilson > > wrote: > >> this is what i have is: https://gist.github.com/3681689 >> >> i see under the fourth example here http://flatironjs.org/#routing that >> i can define my routes as a structure. however my code crashes when i try >> 'curl http://127.0.0.1:3000/test' here: >> /node/fr/node_modules/flatiron/lib/flatiron/plugins/http.js:77 >> if (!app.router.dispatch(req, res, app.http.onError || >> union.errorHand >> ^ >> TypeError: Object # has no method 'dispatch' >> at >> Array.exports.attach.app.createServer.app.server.union.createServer.before >> [as 1] >> > > ------=_Part_241_8006457.1347155044187 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable yes, i just found this:
https://github.com/flatiron/flatiron/issues/19<= /div>

it still doesn't "work" - i curl and it just sits = there, but it isn't crashing ... so, do i still need {"get": function() { .= .... res.end(); } } ?
i'm going back to the docs for now...
On Saturday, September 8, 2012 9:35:44 PM UTC-4, Marak Squires wrote:app.router is a Director.router in= stance. You can't override it like that. Maybe you can try setting app.rout= er.routes, but I don't think that would work either.

The= re should be an API method for adding routes as JSON. Should be in the READ= ME as "mount"

mount(routes, path)

  • routes {object}: Partial ro= uting table to insert into this instance.
  • path {string|Regexp}: Path within the Routing Table to i= nsert the routes into.

Inserts the partial Routing Tablero= utes, into the Routing Table for this Router instance at the specifi= ed path.


On Sat, Sep 8, 2012 at 6:29 PM, shawn wilson= <ag4v...@gmail.com> wrote:
this is what i have is: https://gist.github.com/3681689
i see under the fourth example here http://flatironjs= .org/#routing that i can define my routes as a structure. however = my code crashes when i try 'curl http://127.0.0.1:3000/test' here:
/node/fr/node_modules/flatiron/lib/flatiron/plugins/htt= p.js:77
        if (!app.router.dispatch(req,= res, app.http.onError || union.errorHand
      &n= bsp;                 ^
Ty= peError: Object #<Object> has no method 'dispatch'
    at Array.exports.attach.app.createServer.app.server= .union.createServer.before [as 1]

------=_Part_241_8006457.1347155044187-- ------=_Part_240_8908661.1347155044186--