Guide is wrong/confusing on static handlers #474

mtornwall opened this Issue Mar 22, 2013 · 1 comment


None yet
2 participants

The Cowboy guide offers the following example of configuring a static handler:

Dispatch = [
    {'_', [
        {"/[...]", cowboy_static, [
            {directory, {priv_dir, static, []}},
            {mimetypes, {fun mimetypes:path_to_mimes/2, default}}

I find it misleading because what it actually does is serve files from the priv directory of the static application, while the text leads you to believe that it will be serving files under /priv/static. To avoid confusing readers I suggest changing this to something like {directory, {priv_dir, <yourapp>, [<<"static">>]}}, which has the desired effect.


essen commented Apr 11, 2013

Done in 5b9404f. Thanks!

@essen essen closed this Apr 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment