0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix examples in cowboy_static edoc

This commit is contained in:
Loïc Hoguin 2012-10-18 19:25:23 +02:00
parent e347ae40d0
commit d3277b08ce

View file

@ -81,9 +81,9 @@
%% {<<".js">>, [<<"application/javascript">>]}]}]} %% {<<".js">>, [<<"application/javascript">>]}]}]}
%% %%
%% %% Use the default database in the mimetypes application. %% %% Use the default database in the mimetypes application.
%% {[<<"static">>, '...', cowboy_static, %% {[<<"static">>, '...'], cowboy_static,
%% [{directory, {priv_dir, cowboy, []}}, %% [{directory, {priv_dir, cowboy, []}},
%% {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]]} %% {mimetypes, {fun mimetypes:path_to_mimes/2, default}}]}
%% ''' %% '''
%% %%
%% == ETag Header Function == %% == ETag Header Function ==
@ -110,19 +110,19 @@
%% ==== Examples ==== %% ==== Examples ====
%% ``` %% ```
%% %% A value of default is equal to not specifying the option. %% %% A value of default is equal to not specifying the option.
%% {[<<"static">>, '...', cowboy_static, %% {[<<"static">>, '...'], cowboy_static,
%% [{directory, {priv_dir, cowboy, []}}, %% [{directory, {priv_dir, cowboy, []}},
%% {etag, default}]]} %% {etag, default}]}
%% %%
%% %% Use all avaliable ETag function arguments to generate a header value. %% %% Use all avaliable ETag function arguments to generate a header value.
%% {[<<"static">>, '...', cowboy_static, %% {[<<"static">>, '...'], cowboy_static,
%% [{directory, {priv_dir, cowboy, []}}, %% [{directory, {priv_dir, cowboy, []}},
%% {etag, {attributes, [filepath, filesize, inode, mtime]}}]]} %% {etag, {attributes, [filepath, filesize, inode, mtime]}}]}
%% %%
%% %% Use a user defined function to generate a strong ETag header value. %% %% Use a user defined function to generate a strong ETag header value.
%% {[<<"static">>, '...', cowboy_static, %% {[<<"static">>, '...'], cowboy_static,
%% [{directory, {priv_dir, cowboy, []}}, %% [{directory, {priv_dir, cowboy, []}},
%% {etag, {fun generate_strong_etag/2, strong_etag_extra}}]]} %% {etag, {fun generate_strong_etag/2, strong_etag_extra}}]}
%% %%
%% generate_strong_etag(Arguments, strong_etag_extra) -> %% generate_strong_etag(Arguments, strong_etag_extra) ->
%% {_, Filepath} = lists:keyfind(filepath, 1, Arguments), %% {_, Filepath} = lists:keyfind(filepath, 1, Arguments),