diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/farside/router.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/farside/router.ex b/lib/farside/router.ex index e74f29e..2f0216c 100644 --- a/lib/farside/router.ex +++ b/lib/farside/router.ex @@ -1,5 +1,6 @@ defmodule Farside.Router do @index Application.fetch_env!(:farside, :index) + @route Application.fetch_env!(:farside, :route) use Plug.Router @@ -24,6 +25,19 @@ defmodule Farside.Router do send_resp(conn, 200, resp) end + get "/_/:service/*glob" do + r_path = String.slice(conn.request_path, 2..-1) + + resp = + EEx.eval_file( + @route, + service: service, + instance_url: r_path + ) + + send_resp(conn, 200, resp) + end + get "/:service/*glob" do path = Enum.join(glob, "/") instance = Farside.pick_instance(service) |
