tamasd
tamasd

Reputation: 5923

Webmachine dispatch.conf: how to bind to /

I am working on a hello world webmachine application. What I want is that all requests are mapped to blogtest_resource except if it starts with "static". In this case, it is mapped to static_resource.

{["static", '*'], static_resource, [{root, "./deps"}]}.
{[], blogtest_resource, [{root, "."}]}.

This works nicely if I request / or anything inside static, but it fails if I request /new (which should be handled by blogtest_resource).

Is there something I am not aware of in the configuration of dispatch.conf?

Upvotes: 1

Views: 333

Answers (2)

Jakub Oboza
Jakub Oboza

Reputation: 5421

with just {['*'], some_resource, [{root, "."}]} everything will be mathed so it should be the last pattern to match.

Upvotes: 1

Hynek -Pichi- Vychodil
Hynek -Pichi- Vychodil

Reputation: 26141

I'm not much familiar with the webmachine but I think the second dispatch map data should be

{['*'], blogtest_resource, [{root, "."}]}.

Upvotes: 2

Related Questions