mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 04:57:18 +08:00
Group public routes under a common prefix (#974)
This commit is contained in:
parent
70dac97ce7
commit
fc8799ef8f
2 changed files with 14 additions and 9 deletions
|
@ -124,7 +124,7 @@ defmodule LivebookCLI.Server do
|
|||
defp check_endpoint_availability(base_url) do
|
||||
Application.ensure_all_started(:inets)
|
||||
|
||||
health_url = append_path(base_url, "/health")
|
||||
health_url = append_path(base_url, "/public/health")
|
||||
|
||||
case Livebook.Utils.HTTP.request(:get, health_url) do
|
||||
{:ok, status, _headers, body} ->
|
||||
|
|
|
@ -20,7 +20,19 @@ defmodule LivebookWeb.Router do
|
|||
plug :put_secure_browser_headers
|
||||
end
|
||||
|
||||
scope "/", LivebookWeb do
|
||||
# The /public namespace includes routes with no authentication.
|
||||
# When exposing Livebook through an authentication proxy, this
|
||||
# namespace should be configured as publicly available, in order
|
||||
# for all features to work as expected.
|
||||
|
||||
scope "/public", LivebookWeb do
|
||||
pipe_through :browser
|
||||
|
||||
get "/health", HealthController, :index
|
||||
end
|
||||
|
||||
# The following routes are public, but should be treated as opaque
|
||||
scope "/public", LivebookWeb do
|
||||
pipe_through [:js_output_assets]
|
||||
|
||||
get "/sessions/assets/:hash/*file_parts", SessionController, :show_cached_asset
|
||||
|
@ -78,13 +90,6 @@ defmodule LivebookWeb.Router do
|
|||
ecto_repos: []
|
||||
end
|
||||
|
||||
# Public URLs without authentication
|
||||
scope "/", LivebookWeb do
|
||||
pipe_through :browser
|
||||
|
||||
get "/health", HealthController, :index
|
||||
end
|
||||
|
||||
scope "/authenticate", LivebookWeb do
|
||||
pipe_through :browser
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue