diff --git a/core/systems/feldspar/_routes.ex b/core/systems/feldspar/_routes.ex index e2136d1d1..883880a55 100644 --- a/core/systems/feldspar/_routes.ex +++ b/core/systems/feldspar/_routes.ex @@ -1,9 +1,9 @@ defmodule Systems.Feldspar.Routes do defmacro routes() do quote do - scope "/apps", Systems.Feldspar do + scope "/feldspar", Systems.Feldspar do pipe_through([:browser]) - live("/:id", AppPage) + live("/apps/:id", AppPage) end end end diff --git a/core/systems/feldspar/local_fs.ex b/core/systems/feldspar/local_fs.ex index 114360def..96c168601 100644 --- a/core/systems/feldspar/local_fs.ex +++ b/core/systems/feldspar/local_fs.ex @@ -14,7 +14,7 @@ defmodule Systems.Feldspar.LocalFS do end def get_public_url(id) do - "#{Endpoint.url()}/#{static_path()}/#{id}" + "#{Endpoint.url()}/#{public_path()}/#{id}" end def remove(id) do @@ -33,5 +33,5 @@ defmodule Systems.Feldspar.LocalFS do |> Access.fetch!(:local_fs_root_path) end - def static_path, do: "/feldspar_apps" + def public_path, do: "/feldspar/apps" end diff --git a/core/systems/feldspar/plug.ex b/core/systems/feldspar/plug.ex index 98df4f44c..8fd01567d 100644 --- a/core/systems/feldspar/plug.ex +++ b/core/systems/feldspar/plug.ex @@ -3,7 +3,7 @@ defmodule Systems.Feldspar.Plug do defmacro setup() do quote do - plug(Systems.Feldspar.Plug, at: Systems.Feldspar.LocalFS.static_path()) + plug(Systems.Feldspar.Plug, at: Systems.Feldspar.LocalFS.public_path()) end end diff --git a/core/systems/feldspar/tool_form.ex b/core/systems/feldspar/tool_form.ex index e53ab1213..5342aba47 100644 --- a/core/systems/feldspar/tool_form.ex +++ b/core/systems/feldspar/tool_form.ex @@ -11,8 +11,12 @@ defmodule Systems.Feldspar.ToolForm do %{assigns: %{entity: entity}} = socket, {_local_relative_path, local_full_path, remote_file} ) do + archive_ref = + Feldspar.Public.store(local_full_path) + |> Feldspar.Public.get_public_url() + socket - |> save(entity, %{archive_ref: local_full_path, archive_name: remote_file}) + |> save(entity, %{archive_ref: archive_ref, archive_name: remote_file}) end @impl true diff --git a/core/test/systems/feldspar/app_page_test.exs b/core/test/systems/feldspar/app_page_test.exs index 573f8c474..550e13f4c 100644 --- a/core/test/systems/feldspar/app_page_test.exs +++ b/core/test/systems/feldspar/app_page_test.exs @@ -5,14 +5,14 @@ defmodule Systems.Feldspar.AppPageTest do describe "render an app page" do test "renders page with iframe", %{conn: conn} do - {:ok, _view, html} = live(conn, ~p"/apps/test") + {:ok, _view, html} = live(conn, ~p"/feldspar/apps/test") assert html =~ "