solidusio / solidus_starter_frontend

🎨 Rails-based starter kit for your Solidus storefront.
BSD 3-Clause "New" or "Revised" License
55 stars 37 forks source link

Automatically mount storefront where Solidus is mounted #359

Closed kennyadsl closed 9 months ago

kennyadsl commented 9 months ago

Summary

Right now, no matter where Solidus is mounted, the storefront will live at the root of the application.

Most of the times, this is not the expected behavior because if Solidus lives at /store for example, the user probably also wants the storefront to live at that path.

This change will change the install template to detect where Solidus has been mounted and use that path as the scope of the routes.

Grouping the routes in a scope and in a separate file has the advantage to have all the injected routes isolated, which might help with having a clearer routes file in the application. On the other hand, when Solidus is mounted at /, the scope is useless and might be avoided, but I think we can live with that.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed: