nickwdm
Are multiple routers under a single endpoint possible?
Hello, I have a question regarding how phoenix_swagger mentions in their docs that one can have multiple routers as in the following code:
config :my_app, :phoenix_swagger,
swagger_files: %{
“booking-api.json” => [router: MyApp.BookingRouter],
“reports-api.json” => [router: MyApp.ReportsRouter]
}
I am able to indeed generate 2 separate swaggers for 2 routers, but I cannot find anywhere in the phoenix documentation how I would have 2 routers under the same endpoint. When I place
plug MyApp.BookingRouter
plug MyApp.ReportsRouter
in endpoint.ex, only one is used.
The question is: how is phoenix_swagger intending this feature to be used?
Most Liked
idi527
I didn’t suggest forwarding to an endpoint, but to a router. forward is perfectly fine there. match would do the same thing when used to forward to another endpoint.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








