Routing
Discover how routing works in Front-Commerce application.
Since your Front-Commerce application is based upon Remix, we recommend you to read the official Remix routing documentation to understand how routing works in your Front-Commerce application.
Which routes are loaded?
In your Front-Commerce application, files in the app/routes
folder are loaded
by the Remix router.
In extensions, routes files are detected from the extension's definition in the
index.ts
file of the extension. The
routes
property of the extension definition
must be defined to load the route from the routes
folder of the extension.
You can see an example of an extension with routes in the
faq-demo
extension.
How routes are overridden?
Routes defined in extensions can be overriden by routes defined in your application or extensions.
Example with the product route:
_main.product.$id.tsx
: Defined in thetheme-chocolatine
extension_main.product.$id.tsx
: Defined in an extensionextension/my-extension
will override the one from thetheme-chocolatine
extension._main.product.$id.tsx
: Defined in your application in theapp/routes
folder will override the one from thetheme-chocolatine
extension and the one from theextension/my-extension
extension.