Using cowboy and phoenix in umbrella app in elixir

I have a cowboy app and a phoenix app in a single umbrella app. I want to call one route from cowboy’s handler and rest of the routes from phoenix. How can i acheive this? I defined my cowboy app as a dependency in mix.exs of phoenix app but how do i call cowboy routes from phoenix after doing this much ?

Do you need to do this in your application code? A solution I used was to have cowboy as a websocket handler in one application and phoenix in another. I configured them to use different ports. Then I used nginx’s proxy_pass option to redirect to the correct port based on the request path.

i want to run phoenix server and direct request to cowboy app’s handler for just one phoenix route. My approach was that in my phoenix controller that matches my route, i will call the cowboy only top-level plug. But my cowboy app does not use plug as well.

You can mount your phoenix app into a cowboy app (I’ve seen it done but do not recall the code or location off hand, perhaps someone else here can describe) then they all use the same setup and can inter-operate with ease. :slight_smile: