Introduce support for custom nginx error pages
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
17
lib/service/error_page.ex
Normal file
17
lib/service/error_page.ex
Normal file
@@ -0,0 +1,17 @@
|
||||
defmodule Mobilizon.Service.ErrorPage do
|
||||
@moduledoc """
|
||||
Render an error page
|
||||
"""
|
||||
|
||||
def init do
|
||||
render_error_page()
|
||||
end
|
||||
|
||||
defp render_error_page do
|
||||
content =
|
||||
Phoenix.View.render_to_string(Mobilizon.Web.ErrorView, "500.html", conn: %Plug.Conn{})
|
||||
|
||||
path = Path.join(Application.app_dir(:mobilizon, "priv/errors"), "error.html")
|
||||
File.write(path, content)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user