diff --git a/lib/tusker_push_web/controllers/registrations_controller.ex b/lib/tusker_push_web/controllers/registrations_controller.ex index 40f92c3..ffdb789 100644 --- a/lib/tusker_push_web/controllers/registrations_controller.ex +++ b/lib/tusker_push_web/controllers/registrations_controller.ex @@ -21,7 +21,7 @@ defmodule TuskerPushWeb.RegistrationsController do conn |> json(%{ id: id, - endpoint: url(~p"/mastodon/push/#{id}") + endpoint: url(~p"/mastodon/v1/push/#{id}") }) else {:error, %Changeset{valid?: false} = changeset} -> @@ -64,7 +64,7 @@ defmodule TuskerPushWeb.RegistrationsController do {:registration, TuskerPush.get_registration(id)}, {:ok, _} <- TuskerPush.update_registration(registration, params) do conn - |> json(%{id: id, endpoint: url(~p"/mastodon/push/#{id}")}) + |> json(%{id: id, endpoint: url(~p"/mastodon/v1/push/#{id}")}) else {:registration, nil} -> conn diff --git a/lib/tusker_push_web/router.ex b/lib/tusker_push_web/router.ex index 4f4c68b..33c6947 100644 --- a/lib/tusker_push_web/router.ex +++ b/lib/tusker_push_web/router.ex @@ -8,12 +8,16 @@ defmodule TuskerPushWeb.Router do scope "/app", TuskerPushWeb do pipe_through :api - resources "/registrations", RegistrationsController, only: [:create, :update, :delete] + scope "/v1" do + resources "/registrations", RegistrationsController, only: [:create, :update, :delete] + end end scope "/mastodon", TuskerPushWeb do pipe_through :api - post "/push/:id", PushController, :push + scope "/v1" do + post "/push/:id", PushController, :push + end end end