FubuMVC just isn't that bad

57 views
Skip to first unread message

Jeremy D. Miller

unread,
May 15, 2012, 3:45:18 PM5/15/12
to FubuMVC Develop
I've never completely like the original routing conventions in fubumvc, but this was a serious suggestion on the Web API list on how to get more control over url/routes:

var router =

    new ApiRouter("games")

    .Add(new ApiRouter("{gametitle}")

            .Add(new ApiRouter("Setup").Add(new ApiRouter("{gameid}"))).DispatchTo<SetupController>()

            .Add(new ApiRouter("Resources").Add(new ApiRouter("{resourcetype}").Add(new ApiRouter("{resourceId}")))).DispatchTo<ResourceController>()

            .Add(new ApiRouter("{gameid}")

                    .Add(new ApiRouter("Chat").Add(new ApiRouter("{chatid}"))).DispatchTo<ChatController>()

                    .Add(new ApiRouter("State").Add(new ApiRouter("{stateid}"))).DispatchTo<StateController>()

            ));


We're awesome.  That is all.

 

After seeing some of the recent struggles on the Web API list with more advanced usage, our basic architecture with the well defined configuration model and conventions holds up much better.  We may lack something to be desired in terms of polish, but I think our technical foundation is solid.

Jeremy D. Miller
The Shade Tree Developer
jeremy...@yahoo.com

Dru Sellers

unread,
May 15, 2012, 3:49:40 PM5/15/12
to fubumv...@googlegroups.com
+1

--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To post to this group, send email to fubumv...@googlegroups.com.
To unsubscribe from this group, send email to fubumvc-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/fubumvc-devel?hl=en.

Michael Murray

unread,
May 15, 2012, 3:52:04 PM5/15/12
to fubumv...@googlegroups.com
Amen to that!

Gary Cox

unread,
May 15, 2012, 3:55:13 PM5/15/12
to fubumv...@googlegroups.com
I'll drink to that! Cheers
Thank you,
Gary Cox

James Crowley

unread,
May 16, 2012, 6:17:03 AM5/16/12
to fubumv...@googlegroups.com
Having just had my first experience playing with Web API, +100 to
this. But please please help us Fubu beginners with some chunky
samples and more docs! :)

J

Jon Canning

unread,
May 16, 2012, 6:32:47 AM5/16/12
to fubumv...@googlegroups.com
Have a go with ServiceStack if you're looking to build an API

James Crowley

unread,
May 16, 2012, 7:37:01 AM5/16/12
to fubumv...@googlegroups.com
yeah, I'm going to take a more in depth look at that.

In this case though I'm trying to avoid the overhead of having
separate API endpoints to the public facing website. Even just in the
read-only world... GET request from a browser? Serve HTML. GET
request with accept header or a .xml/.json type extension, serve
appropriate media type. Sure you can do it in ASP.NET MVC but it sure
don't feel that nice. Am I chasing a dream that in fact is going to
come and bite me later?

J

Ryan Rauh

unread,
May 16, 2012, 12:24:20 PM5/16/12
to fubumv...@googlegroups.com
@James its not a dream. Its actually quite possible and easy to do that in FubuMVC, but like you said the code sample and docs are lacking. 

James Crowley

unread,
May 20, 2012, 3:31:08 PM5/20/12
to fubumv...@googlegroups.com
Ryan - or anyone else - would you mind giving me a quick gist of the
kind of config I'd need to get that? I've found an example here:
http://lostechies.com/joshuaflanagan/2010/02/08/adding-variable-output-behavior-to-your-fubumvc-actions/
to do it based on accept headers (though I don't think this is using
the 'conneg' stuff?) and a querystring override, but I'm not sure
where to start in order to get the .json/.xml extensions ignored as
part of my route input?

Thanks!

J
--

---
James Crowley
CTO, FundApps - a new generation in financial services software -
http://www.fundapps.co/
Founder, developerFusion - the global developer community -
http://www.developerfusion.com/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley

Jeremy D. Miller

unread,
May 20, 2012, 8:54:21 PM5/20/12
to fubumv...@googlegroups.com
The old blog post you're referencing was a one off, and we don't support the .json/.xml extensions out of the box (I'm still not sure how I'd go about supporting it TBH).

The built in conneg uses the http accept and content-type headers out of the box.  There's been quite an overhaul of the conneg code in master that is much more flexible, but that hasn't hit a nuget release quite yet.  

To apply conneg to your endpoints, you can either do the one-off [Conneg] attribute or create a convention from the Media.Apply******** methods in the FubuRegistry.  On the next nuget release, any endpoint without any kind of prior output will just get the conneg applied to it automatically as an ease of use thing.
 


From: James Crowley <james....@gmail.com>
To: fubumv...@googlegroups.com
Sent: Sun, May 20, 2012 2:42:09 PM
Subject: Re: [fubumvc] FubuMVC just isn't that bad
>> fubumvc-devel+unsub...@googlegroups.com.

>> For more options, visit this group at
>> http://groups.google.com/group/fubumvc-devel?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "FubuMVC Development Group" group.
> To post to this group, send email to fubumv...@googlegroups.com.
> To unsubscribe from this group, send email to
> fubumvc-devel+unsub...@googlegroups.com.

> For more options, visit this group at
> http://groups.google.com/group/fubumvc-devel?hl=en.



--

---
James Crowley
CTO, FundApps - a new generation in financial services software -
http://www.fundapps.co/
Founder, developerFusion - the global developer community -
http://www.developerfusion.com/

linkedin: http://linkedin.com/in/jamescrowley
twitter: http://twitter.com/jamescrowley

--
You received this message because you are subscribed to the Google Groups "FubuMVC Development Group" group.
To post to this group, send email to fubumv...@googlegroups.com.
To unsubscribe from this group, send email to fubumvc-devel+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages