From d4e4d702ab6cb5db006e98e43d76cbac40783613 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Tue, 4 Apr 2023 11:50:07 -0600 Subject: [PATCH] Drop REST API boilerplate for now --- apps/api/lib/api/client/controllers/error_json.ex | 15 --------------- apps/api/lib/api/endpoint.ex | 13 ------------- apps/api/lib/api/router.ex | 11 ----------- 3 files changed, 39 deletions(-) delete mode 100644 apps/api/lib/api/client/controllers/error_json.ex delete mode 100644 apps/api/lib/api/router.ex diff --git a/apps/api/lib/api/client/controllers/error_json.ex b/apps/api/lib/api/client/controllers/error_json.ex deleted file mode 100644 index fedf5011d..000000000 --- a/apps/api/lib/api/client/controllers/error_json.ex +++ /dev/null @@ -1,15 +0,0 @@ -defmodule API.ErrorJSON do - # If you want to customize a particular status code, - # you may add your own clauses, such as: - # - # def render("500.json", _assigns) do - # %{errors: %{detail: "Internal Server Error"}} - # end - - # By default, Phoenix returns the status message from - # the template name. For example, "404.json" becomes - # "Not Found". - def render(template, _assigns) do - %{errors: %{detail: Phoenix.Controller.status_message_from_template(template)}} - end -end diff --git a/apps/api/lib/api/endpoint.ex b/apps/api/lib/api/endpoint.ex index c4330fe9b..2154ce90b 100644 --- a/apps/api/lib/api/endpoint.ex +++ b/apps/api/lib/api/endpoint.ex @@ -22,17 +22,4 @@ defmodule API.Endpoint do websocket: true, longpoll: false, connect_info: [:user_agent, :peer_data, :x_headers] - - # plug Plug.Parsers, - # parsers: [:urlencoded, :multipart, :json], - # pass: ["*/*"], - # json_decoder: Phoenix.json_library() - - # plug Plug.MethodOverride - # plug Plug.Head - - # # TODO: probably we don't need a session here at all - # plug Plug.Session, API.Session.options() - - # plug API.Router end diff --git a/apps/api/lib/api/router.ex b/apps/api/lib/api/router.ex deleted file mode 100644 index bbae6759e..000000000 --- a/apps/api/lib/api/router.ex +++ /dev/null @@ -1,11 +0,0 @@ -defmodule API.Router do - use API, :router - - pipeline :api do - plug :accepts, ["json"] - end - - scope "/client", API.Client do - pipe_through :api - end -end