Flares are basically plugins for ATON. Check out the official API docs.
- They intend to extend the functionalities of your ATON instance, for multiple web-apps
- They can provide both client and server components (e.g. REST API enrichment)
- They automatically equip the official front-end (Hathor)
They are located in <your-main-ATON-folder>/config/flares/
The model is pretty much the same for web-apps plug&play architecture – i.e. they can be pugged in while the services are running
Structure
The basic structure involves:
- a public/ subfolder, providing client components (e.g. javascript/ES modules) loaded by the web-app / front-end
- a flare.json representing the descriptor
Sample flare.json:
{
"name": "My first flare",
"client":{
"files": [
"myflare.js"
]
}
}
This basically tells ATON we want to add a flare called “My first flare“, loading a simple javascript file located in our public/ folder.
A very basic example for myflare.js:
let F = new ATON.Flare();
// do stuff for this flare initialization
F.setup = ()=>{
}
// optional update routine (executed continuously)
F.update = ()=>{
}
F.register(); // Register and activate this flare in ATON
Another, more compact, example for myflare.js where we also register the flare with a friendly name, so it can be accessed directly via ATON.Flares.MyTestFlare
new ATON.Flare(
()=>{
// Do setup stuff
}
).register("MyTestFlare");