philomena/lib/philomena_web/plugs/render_time_plug.ex

12 lines
212 B
Elixir
Raw Permalink Normal View History

2019-11-17 19:18:21 +01:00
defmodule PhilomenaWeb.RenderTimePlug do
2019-08-16 02:28:12 +02:00
import Plug.Conn
# No options
def init([]), do: false
# Assign current time
def call(conn, _opts) do
conn |> assign(:start_time, Time.utc_now())
end
end