Skip to content

controller

simmontali edited this page Sep 10, 2019 · 3 revisions

Controller

Since Aeria was born to be as flexible as it could be, there may be situations where you need to register a controller without being able to call Aeria's controller register.

To do this, you just need to create a new config file. The 3 fields will be filled like this:

  • "name" defines the name for this controller configuration.
  • "kind" defines the type of configuration: we're gonna set it to "route" this time.
  • "spec" defines the specific configuration for this controller.
{
  "name": "bookscontroller",
  "spec": {},
  "kind": "controller"
}

If you want to leave this configuration disabled for now, you can add "enabled": false to these fields.

Specs

Specs are really light this time: we just need to declare the namespace of our controller. Using our example controller from the Route's wiki page, we're gonna set "namespace" to "BooksController".

Our config file is now ready and looks like this:

{
 "name": "bookscontroller",
 "spec": {
   "namespace": "BooksController"
 },
 "kind": "controller"
}

Our controller is now registered and ready to use.

Clone this wiki locally