Fork me on GitHub
#pedestal
<
2018-12-02
>
devurandom19:12:35

Is there an interceptor which can turn the path /foo/bar into /bar and /foo/bar/baz into /bar/baz and so on? Basically strip a static part of the path off?

ddeaguiar14:12:49

AFAIK, the only interceptor that does this is for serving resources.

devurandom01:12:19

Which one does it? (ring-middlewares/resource document-root)?

ddeaguiar14:12:47

@U368JQA01 it’s based on the bits of ring’s resource middleware. When :io.pedestal.http/resource-path is present in the service map, the value is used as the resource path root.

devurandom00:12:30

i.e. the resources are mounted into the route at :io.pedestal.http/resource-path? And hence the middleware treats every path it sees in the route as relative to that resource-path?

devurandom00:12:00

i.e. with a route containing "/my/resources/" -&gt; resource-middleware and resource-path=/my, the resource-middleware would look for "/resources/" in the resource directory / classpath?