diff options
Diffstat (limited to 'lib/matrix_app_service_web/router.ex')
-rw-r--r-- | lib/matrix_app_service_web/router.ex | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/lib/matrix_app_service_web/router.ex b/lib/matrix_app_service_web/router.ex index 21ccc39..ca37fe0 100644 --- a/lib/matrix_app_service_web/router.ex +++ b/lib/matrix_app_service_web/router.ex @@ -1,4 +1,13 @@ defmodule MatrixAppServiceWeb.Router do + @moduledoc """ + Provides the Matrix Application Service API routes. + + https://matrix.org/docs/spec/application_service/r0.1.2 + """ + + @doc """ + This macro injects the API routes in a Phoenix router. + """ defmacro routes() do quote do pipeline :matrix_api do @@ -11,16 +20,16 @@ defmodule MatrixAppServiceWeb.Router do scope path, MatrixAppServiceWeb.V1 do pipe_through :matrix_api - put "/transactions/:txn_id", TransactionController, :create + put "/transactions/:txn_id", TransactionController, :push - get "/users/:user_id", UserController, :show - get "/rooms/:room_alias", RoomController, :show + get "/users/:user_id", UserController, :query + get "/rooms/:room_alias", RoomController, :query - get "/thirdparty/protocol/:protocol", ThirdPartyController, :show - get "/thirdparty/user/:protocol", ThirdPartyController, :show - get "/thirdparty/location/:protocol", ThirdPartyController, :show - get "/thirdparty/location", ThirdPartyController, :show - get "/thirdparty/user", ThirdPartyController, :show + get "/thirdparty/protocol/:protocol", ThirdPartyController, :query_protocol + get "/thirdparty/user/:protocol", ThirdPartyController, :query_users + get "/thirdparty/location/:protocol", ThirdPartyController, :query_locations + get "/thirdparty/location", ThirdPartyController, :query_location_by_alias + get "/thirdparty/user", ThirdPartyController, :query_user_by_id end end end |