Skip to content

Commit

Permalink
Make wobserver optional
Browse files Browse the repository at this point in the history
  • Loading branch information
vbaranov committed Aug 8, 2020
1 parent edf4627 commit 2dd909c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/block_scout_web/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ config :wobserver,

config :block_scout_web, BlockScoutWeb.ApiRouter,
writing_enabled: System.get_env("DISABLE_WRITE_API") != "true",
reading_enabled: System.get_env("DISABLE_READ_API") != "true"
reading_enabled: System.get_env("DISABLE_READ_API") != "true",
wobserver_enabled: System.get_env("WOBSERVER_ENABLED") == "true"

config :block_scout_web, BlockScoutWeb.WebRouter, enabled: System.get_env("DISABLE_WEBAPP") != "true"

Expand Down
4 changes: 3 additions & 1 deletion apps/block_scout_web/lib/block_scout_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ defmodule BlockScoutWeb.Router do
alias BlockScoutWeb.Plug.GraphQL
alias BlockScoutWeb.{ApiRouter, WebRouter}

forward("/wobserver", Wobserver.Web.Router)
if Application.get_env(:block_scout_web, ApiRouter)[:wobserver_enabled] do
forward("/wobserver", Wobserver.Web.Router)
end
forward("/admin", BlockScoutWeb.AdminRouter)

pipeline :browser do
Expand Down

0 comments on commit 2dd909c

Please sign in to comment.