Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

404 when using Rack::Builder #5

Open
EppO opened this issue Sep 24, 2013 · 4 comments
Open

404 when using Rack::Builder #5

EppO opened this issue Sep 24, 2013 · 4 comments

Comments

@EppO
Copy link

EppO commented Sep 24, 2013

Does reel-rack support Rack::Builder in the config.ru ?
When I try to use map inside a Rack::Builder.new block, I get only 404 responses.

I tried with:

require_relative "hello"
require_relative "world"
require_relative "request"

app = Rack::Builder.new do
  #use Request

  map '/' do
    run lambda { [ 200, {"Content-Type" => "text/html"}, "What did u expect ?" ] }
  end

  map '/hello' do
    run Hello.new
  end

  map '/world' do
    run World.new
  end
end

run app

all the URLs above (/, /hello, /world) sends back 404

@EppO
Copy link
Author

EppO commented Sep 25, 2013

I tried couple of other things like.
This doesn't work either:

app = Rack::URLMap.new('/hello' => Hello.new,
                       '/'      => lambda { |env| [200, {'Content-Type' => 'text/plain'}, ' What did u expect ?'] })
run app

What works on the other side is when I don't use map inside the Rack::Builder.new block:

app = Rack::Builder.new do
  #use Request

  run Hello.new
end

run app

So reel-rack can use a Rack::Builder app but doesn't seem to be able to get map routes correctly.

@tarcieri
Copy link
Member

Wonder if this is related to our use of Rack::MockRequest

@EppO
Copy link
Author

EppO commented Oct 4, 2013

Is there any workaround to be able to use different Rack endpoints ?

@tarcieri
Copy link
Member

tarcieri commented Oct 4, 2013

Not that I know of. Perhaps we're using Rack incorrectly here?

@tarcieri tarcieri changed the title Rack::Builder in config.ru 404 when using Rack::Builder Apr 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants