diff options
author | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-05-26 19:03:01 +0200 |
---|---|---|
committer | Pierre de Lacroix <pierre@pdelacroix.com> | 2020-05-26 19:03:01 +0200 |
commit | 7dfba47cf40d89bd48d6ab1c243175d56b4ea24d (patch) | |
tree | be1b76ffdc8ce3c6e5ee0740e607efb270d7c0c3 | |
parent | add TransactionModule (diff) |
handle giving a custom path
-rw-r--r-- | lib/matrix_app_service/phoenix/router.ex | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/lib/matrix_app_service/phoenix/router.ex b/lib/matrix_app_service/phoenix/router.ex index a85a5fa..4ab6bf2 100644 --- a/lib/matrix_app_service/phoenix/router.ex +++ b/lib/matrix_app_service/phoenix/router.ex @@ -1,28 +1,24 @@ defmodule MatrixAppService.Phoenix.Router do - defmacro routes() do quote do pipeline :matrix_api do plug :accepts, ["json"] end - scope "/matrix", MatrixAppServiceWeb.V1 do + path = Application.compile_env(:matrix_app_service, :path, "/") + scope path, MatrixAppServiceWeb.V1 do pipe_through :matrix_api - # scope "/v1", V1 do - put "/transactions/:txn_id", TransactionController, :create + put "/transactions/:txn_id", TransactionController, :create - get "/users/:user_id", UserController, :show - get "/rooms/:room_alias", RoomController, :show + get "/users/:user_id", UserController, :show + get "/rooms/:room_alias", RoomController, :show - # scope "/thirdparty", ThirdParty do - 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 - # end - # end + 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 end end end |