Rack: URL Mapping

P

Paul A.

Hi,

I am trying to write two kind of Rake routes. As we can see, Rake allow
us to write such routes as instance:

app = Rack::URLMap.new('/test' => SimpleAdapter.new,
'/files' => Rack::File.new('.'))

In my case, I would like to handle those routes:

- "/" or "index"
- "/*" (in order to match any other routes)

So I had trying this:

app = Rack::URLMap.new('/index' => SimpleAdapter.new,
'/' => Rack::File.new('./public'))

This work well, but... I don't know how to add '/' path (as alternative
of '/index' path). The path '/*' is not interpreted as a joker,
according to my tests. Do you know how I could do?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,413
Latest member
ReeceDorri

Latest Threads

Top