문제

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