SolidJSS
SolidJSโ€ข3y agoโ€ข
9 replies
Nyantastic

Routing in SolidJS "microfrontend"

Hello,
I'm sorry I allowed myself to make another post because I couldn't find how to add pictures to my previous one.
I'll start again, perhaps with a better explanation of my issue.

I am working on a big app (MyApp on the pictures) which role is to share user connection and navigation between several modules (which are pretty big too, that's why I chose to make them as separate apps).

Each module has its own routing, is built and exported as library, and called in MyApp by doing <MyModule ...props />.
Since I'm not good with words, I chose to make drawings of the issue ๐Ÿ˜…

To summarize the issue: I can navigate through my modules in MyApp by clicking on the buttons inside the app (each module's buttons route to the module's different pages). But when I try to access the pages with the browser, I route to MyApp's '/myapp/module1/page1', which doesn't exist in reality (in my example it exists because I made it for test purposes).

It's very important to me that we can navigate with the browser, because some of my modules' pages are accessed via external apps for some users.
If possible, I'd rather not export every single page of every module to create more routes in MyApp.
Is there a way to simply "redirect" from MyApp's route /myapp/module1/page1 to the module1's internal route?

Thank you for your time and attention!
Step_1.jpg
Step_2.jpg
Step_3.jpg
Step_4.jpg
Was this page helpful?