Extensions
Start using extensions and runtime plugins
What is an extension
Initialize a project
Prepare the source logic
/* @namespace Router/getRoutes */
function getRoutes(options) {
return [
'/home',
'/my-account'
]
}
const routes = getRoutes(); // routes + additional routes (from plugins)!
app.setRoutes(routes)const getRoutes = Mosaic.middleware(
function getRoutes(options) {
return [
// ...routes
]
},
'Router/getRoutes'
);
const routes = getRoutes();
// routes + additional routes (from plugins)!
// see the explanation below
app.setRoutes(routes)Create a package
Install and enable the module
Write a plugin
See it in work!
Acknowledge other extensions' features
Build configuration pluginsLast updated