質問

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?

役に立ちましたか?

解決

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

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

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top