rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Question about using a host name with URLMap
@ 2011-02-25 21:02 Hoofman
  0 siblings, 0 replies; only message in thread
From: Hoofman @ 2011-02-25 21:02 UTC (permalink / raw)
  To: Rack Development

I am having difficulty following the documentation for Rack::URLMap to
map a host name to a separate app. Please explain how to modify
config.ru to accomplish this (rack 1.2.1).
Requesting http://api.localhost.lan/ responds with "main site" instead
of "api site".

#config.ru

map 'http://api.localhost.lan/' do
	run lambda { [200, { "Content-Type" => "text/plain" }, "api site"] }
end

map '/' do
	run lambda { [200, { "Content-Type" => "text/plain" }, "main site"] }
end

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-25 22:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-25 21:02 Question about using a host name with URLMap Hoofman

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).