Skip to content

Commit

Permalink
Document host and script_name at endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Apr 18, 2020
1 parent e45ddd0 commit 7ece504
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/phoenix/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ defmodule Phoenix.Endpoint do
"""
@callback static_lookup(path :: String.t) :: {String.t, String.t} | {String.t, nil}

@doc """
Returns the script name from the :url configuration.
"""
@callback script_name() :: [String.t]

@doc """
Returns the host from the :url configuration.
"""
@callback host() :: String.t

# Channels

@doc """
Expand Down
4 changes: 2 additions & 2 deletions lib/phoenix/endpoint/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,9 @@ defmodule Phoenix.Endpoint.Supervisor do
Invoked to warm up caches on start and config change.
"""
def warmup(endpoint) do
endpoint.host
endpoint.host()
endpoint.script_name()
endpoint.path("/")
endpoint.script_name
warmup_url(endpoint)
warmup_static(endpoint)
:ok
Expand Down

0 comments on commit 7ece504

Please sign in to comment.