pull/2193/head
Ayrat Badykov 5 years ago
parent 262b59abce
commit d47cb2bda4
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 2
      apps/block_scout_web/lib/block_scout_web/templates/api_docs/eth_rpc.html.eex
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/api_docs/index.html.eex
  3. 10
      apps/block_scout_web/lib/block_scout_web/views/api_docs_view.ex

@ -2,7 +2,7 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<h1 class="card-title margin-bottom-sm"><%= gettext("ETH RPC API Documentation") %></h2> <h1 class="card-title margin-bottom-sm"><%= gettext("ETH RPC API Documentation") %></h2>
<p class="api-text-monospace" data-endpoint-url="<%= BlockScoutWeb.Endpoint.url() %>/api/eth_rpc">[ <%= gettext "Base URL:" %> <%= BlockScoutWeb.Endpoint.url() %>/api/eth_rpc ]</p> <p class="api-text-monospace" data-endpoint-url="<%= BlockScoutWeb.Endpoint.url() %>/api/eth_rpc">[ <%= gettext "Base URL:" %> <%= url() %>/api/eth_rpc ]</p>
<p class="card-subtitle margin-bottom-0"> <p class="card-subtitle margin-bottom-0">
<%= gettext "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " %> <%= gettext "This API is provided to support some rpc methods in the exact format specified for ethereum nodes, which can be found " %>

@ -2,7 +2,7 @@
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<h1 class="card-title margin-bottom-sm"><%= gettext("API Documentation") %></h2> <h1 class="card-title margin-bottom-sm"><%= gettext("API Documentation") %></h2>
<p class="api-text-monospace" data-endpoint-url="<%= BlockScoutWeb.Endpoint.url() %>/api">[ <%= gettext "Base URL:" %> <%= BlockScoutWeb.Endpoint.url() %>/api ]</p> <p class="api-text-monospace" data-endpoint-url="<%= BlockScoutWeb.Endpoint.url() %>/api">[ <%= gettext "Base URL:" %> <%= url() %>/api ]</p>
<p class="card-subtitle margin-bottom-0"><%= gettext "This API is provided for developers transitioning their applications from Etherscan to BlockScout. It supports GET and POST requests." %></p> <p class="card-subtitle margin-bottom-0"><%= gettext "This API is provided for developers transitioning their applications from Etherscan to BlockScout. It supports GET and POST requests." %></p>
</div> </div>
<div class="api-anchors-list"> <div class="api-anchors-list">

@ -1,7 +1,7 @@
defmodule BlockScoutWeb.APIDocsView do defmodule BlockScoutWeb.APIDocsView do
use BlockScoutWeb, :view use BlockScoutWeb, :view
alias BlockScoutWeb.LayoutView alias BlockScoutWeb.{Endpoint, LayoutView}
def action_tile_id(module, action) do def action_tile_id(module, action) do
"#{module}-#{action}" "#{module}-#{action}"
@ -33,4 +33,12 @@ defmodule BlockScoutWeb.APIDocsView do
"&#{param.key}=" <> "{<strong>#{param.placeholder}</strong>}" "&#{param.key}=" <> "{<strong>#{param.placeholder}</strong>}"
end) end)
end end
defp url do
if System.get_env("BLOCKSCOUT_HOST") do
"http://" <> System.get_env("BLOCKSCOUT_HOST")
else
Endpoint.url()
end
end
end end

Loading…
Cancel
Save