Over the last couple of years we've spent a lot of time debugging runtime issues with Events and the data they have access to.
After a short introduction to Web's Event system, we cover two built-in helpers that are part of the data context for each page request in DADI Web.
Events
The Event system in DADI Web provides developers with a way to perform tasks related to the current request, end the current request or extend the data context that is passed to the rendering engine.
An Event is a JavaScript file stored in your application's workspace folder and attached to a page.json file using the "events" array:
"events": [
"my-event"
]It is declared in the following way, receiving the original HTTP request, the response, the data context and a callback function to return control back to the controller that called it:
const Event = function (req, res, data, callback) {
}The data context
Tutorials
Last Updated:
September 2019

