Skip to content

Commit

Permalink
Added a debug plug
Browse files Browse the repository at this point in the history
  • Loading branch information
kotva006 committed May 6, 2024
1 parent 4c3fbe8 commit d7c7c5f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lib/dotcom_web/plugs/debug.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
defmodule DotcomWeb.Plugs.Debug do
@moduledoc """
Filters alerts by timeframe. Used by pages that list alerts
and have a timeframe filter:
- /alerts
- /schedules/ROUTE/alerts
- /stops/STOP/alerts
"""
require Logger

use Plug.Builder

@pipeline Application.compile_env(:dotcom, :secure_pipeline)[:force_ssl]

@impl Plug
def call(conn, _) do
Logger.info("#{@pipeline} **************************")
conn
end
end
3 changes: 3 additions & 0 deletions lib/dotcom_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ defmodule DotcomWeb.Router do
alias DotcomWeb.StaticPage

pipeline :secure do
IO.inspect("SECURE PIPELINE &&&&&&&&&&&&&&&&&&&&&&&")
Logger.info("THIS IS THE SECURE PIPE ################")

plug(DotcomWeb.Plugs.Debug)

if force_ssl = Application.compile_env(:dotcom, :secure_pipeline)[:force_ssl] do
Logger.info("Force SSL is Called")
plug(Plug.SSL, force_ssl)
Expand Down

0 comments on commit d7c7c5f

Please sign in to comment.