From 65a77a8f4888ad9266906f351c92477b4c697b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 11 Feb 2025 16:56:30 +0100 Subject: [PATCH] Use the new json module for the file_server example --- examples/file_server/Makefile | 2 +- examples/file_server/src/directory_h.erl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/file_server/Makefile b/examples/file_server/Makefile index df8f3110..12a4e15e 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 7d7bd9ad..b52fc74f 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]]],