I’ve set up my umbrella app into three apps - simple Plug app, Phoenix app (called Chemistry), and database.
The first app simply receives a request, queries the database for the appropriate record, and redirects to an external url on that record. The second phase of the project was making this app into part of an umbrella app structure and separating the database into its own app. Additionally, I created a Phoenix app to handle uploading images.
Goal: do not load the entire Phoenix app if it’s not necessary. My idea was to set up routing so that the request is forwarded from the Plug app to the Phoenix/Chemistry app.
I’ve not been successful in implementing it this way - only in the opposite direction. When I forward from the Plug app - forward '/chemistry', to: Chemistry.Router
- it returns the following compilation error:
(UndefinedFunctionError) function Chemistry.Router.init/1 is undefined (module Chemistry.Router is not available)
Am I not correctly importing the module? Any tips on the best way to handle routes for two applications?
Thanks!