Skip to content

Commit

Permalink
Use the new json module for the file_server example
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Feb 11, 2025
1 parent 761c1f8 commit 65a77a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/file_server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PROJECT = file_server
PROJECT_DESCRIPTION = Cowboy file server example with directory listing
PROJECT_VERSION = 1

DEPS = cowboy jsx
DEPS = cowboy
dep_cowboy_commit = master

REL_DEPS = relx
Expand Down
2 changes: 1 addition & 1 deletion examples/file_server/src/directory_h.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ charsets_provided(Req, State) ->

list_json(Req, {Path, Fs}) ->
Files = [unicode:characters_to_binary(F) || F <- Fs],
{jsx:encode(Files), Req, Path}.
{json:encode(Files), Req, Path}.

list_html(Req, {Path, Fs}) ->
Body = [[links(Path, unicode:characters_to_binary(F)) || F <- [".."|Fs]]],
Expand Down

0 comments on commit 65a77a8

Please sign in to comment.