Adding an additional router application on top of an existing endpoint

Hi,
we have a web application which we deploy with an additional application with customer specific routes. Currently I do this by adding the following to the web application router:

forward("/customer", CustomerApplication.Router)

but this has some drawbacks. One is that I get a compilation warning because the web application does not depend on the customer application (it’s the other way around) and one is that I need to modify the web application in order to build for a specific customer application, so it can’t be generic.

Is there a way to “join” endpoints/routers so that I can define an additional endpoint/router in the customer application? I’ve tried a few ways but it seems it only allows one router plug. If somebody has a good tip for this I’d be grateful.

Have you tried terraform? GitHub - poteto/terraform: A simple plug for incrementally transforming an API into Phoenix. Check out the blog post:

Thanks, I’ll check it out. It does seem that I still need to modify the web application router to call the customer router though.