Creating a Plugin
All plugins in BlueRain OS extend the Plugin Class.
Let's create a simple plugin that registers a new route /hello-world
. When this route is called, HelloWorldComponent
component should be rendered.
Notice that we also defined pluginName
and slug
static properties.
pluginName
defines the name of the plugin. This is a required property and not providing one will throw error when you register the plugin.slug
property defines the slug for your plugin. If you don't give one, then BlueRain will automatically create a slug by kebab casing thepluginName
property. It's a good convention manually define theslug
. This slug is used to get an app from thePluginRegistry
.hooks
defines the hooks plugin would add when added to the system.uses
defines the hooks plugin is running .
You can define even more Plugin properties. For a complete list, please refer to the API Reference.
Last updated