Hi,

Usher or Rack::Mount which are rack based routers should be able to handle this easily.

Cheers
Daniel


On Mon, Feb 8, 2010 at 9:36 AM, misza222 <misza222@gmail.com> wrote:
On 7 Feb, 11:57, James Tucker <jftuc...@gmail.com> wrote:
> On 6 Feb 2010, at 16:58, misza222 wrote:
>
> > Hi,
>
> > Here is a problem I have.
> > There is an app which consists of multiple subapps. Requests needs to
> > be dispatched to the particular subapp based on the domain name.
> > I thought Rack::URLMap may be a solution but couldn't make it to work
> > so eventually I created my own rack middleware that allowed me to
> > achieve it. Here is how it looks likehttp://github.com/misza222/dispatch_by_domain
> > But am I reinventing a wheel here? Is there any way to achieve the
> > same thing with existing rack middleware?
>
> map "http://mydomain.com/" do
>   run App1.new
> end
>
> map "http://otherdomain.com/" do
>   run App2.new
> end
>
>
>
> > Cheers,
>
> > Michal
>
>

Thanks James.

Where is 'map' method defined as I can't find it in the code?
And is there any way to make one of those apps a default one so it can
catch all unmatched paths?

--
Cheers,

Michal