From: Daniel N <has.sox@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: Middleware to dispatch request to multiple applications based on request domain name
Date: Mon, 8 Feb 2010 09:54:33 +1100 [thread overview]
Message-ID: <2fff50391002071454y1f153b72tece6a1040140ebc8@mail.gmail.com> (raw)
In-Reply-To: <09592190-728b-44a0-82ac-dda461bbc39e@z41g2000yqz.googlegroups.com>
[-- Attachment #1: Type: text/plain, Size: 1243 bytes --]
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
>
[-- Attachment #2: Type: text/html, Size: 2117 bytes --]
next prev parent reply other threads:[~2010-02-07 22:54 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
2010-02-07 22:54 ` Daniel N [this message]
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=2fff50391002071454y1f153b72tece6a1040140ebc8@mail.gmail.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).