diff --git a/lib/music_library_web/controllers/stats_controller.ex b/lib/music_library_web/controllers/stats_controller.ex new file mode 100644 index 00000000..4e766cef --- /dev/null +++ b/lib/music_library_web/controllers/stats_controller.ex @@ -0,0 +1,10 @@ +defmodule MusicLibraryWeb.StatsController do + use MusicLibraryWeb, :controller + + alias MusicLibrary.Records + + def index(conn, _params) do + records_count = Records.count_records() + render(conn, :index, records_count: records_count) + end +end diff --git a/lib/music_library_web/controllers/stats_html.ex b/lib/music_library_web/controllers/stats_html.ex new file mode 100644 index 00000000..e7e4fe94 --- /dev/null +++ b/lib/music_library_web/controllers/stats_html.ex @@ -0,0 +1,5 @@ +defmodule MusicLibraryWeb.StatsHTML do + use MusicLibraryWeb, :html + + embed_templates "stats_html/*" +end diff --git a/lib/music_library_web/controllers/stats_html/index.html.heex b/lib/music_library_web/controllers/stats_html/index.html.heex new file mode 100644 index 00000000..f8373a65 --- /dev/null +++ b/lib/music_library_web/controllers/stats_html/index.html.heex @@ -0,0 +1,13 @@ +