aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2025-02-11 16:56:30 +0100
committerLoïc Hoguin <[email protected]>2025-02-11 16:56:30 +0100
commit65a77a8f4888ad9266906f351c92477b4c697b18 (patch)
tree745c265f8dd0b7ab992bedee38d67f197d8c21f5
parent761c1f8dca936cd529dbada0b85cd2280ee7dca4 (diff)
downloadcowboy-65a77a8f4888ad9266906f351c92477b4c697b18.tar.gz
cowboy-65a77a8f4888ad9266906f351c92477b4c697b18.tar.bz2
cowboy-65a77a8f4888ad9266906f351c92477b4c697b18.zip
Use the new json module for the file_server example
-rw-r--r--examples/file_server/Makefile2
-rw-r--r--examples/file_server/src/directory_h.erl2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/file_server/Makefile b/examples/file_server/Makefile
index df8f311..12a4e15 100644
--- a/examples/file_server/Makefile
+++ b/examples/file_server/Makefile
@@ -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
diff --git a/examples/file_server/src/directory_h.erl b/examples/file_server/src/directory_h.erl
index 7d7bd9a..b52fc74 100644
--- a/examples/file_server/src/directory_h.erl
+++ b/examples/file_server/src/directory_h.erl
@@ -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]]],