rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: misza222 <misza222@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: Re: Middleware to dispatch request to multiple applications based on request domain name
Date: Sun, 7 Feb 2010 14:36:45 -0800 (PST)	[thread overview]
Message-ID: <09592190-728b-44a0-82ac-dda461bbc39e@z41g2000yqz.googlegroups.com> (raw)
In-Reply-To: <09F3BCD8-6945-4DCC-BA70-A7F1777DC09C@gmail.com>

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

  reply	other threads:[~2010-02-07 22:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-06 16:58 Middleware to dispatch request to multiple applications based on request domain name misza222
2010-02-07 11:57 ` James Tucker
2010-02-07 22:36   ` misza222 [this message]
2010-02-07 22:54     ` Daniel N
2010-02-08 10:29     ` James Tucker
2010-02-08 21:17       ` misza222

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=09592190-728b-44a0-82ac-dda461bbc39e@z41g2000yqz.googlegroups.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).