mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-28 02:18:50 +00:00
Drop REST API boilerplate for now
This commit is contained in:
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user