Middleware
It is possible to execute functions before or after the function associated with an endpoint, this in order to reprocess certain data or carry out previous validations.
It is possible to create a custom function that is executed before or after the function associated with an endpopint, the function will be created with the desired name and later it will be passed as a variable.
The execution of the middleware can only be achieved with the funcionm format, it cannot with the @route
and @page
macros. The following structure must be specified where myfunction is the function associated with the path "/ verify /: status"
. In line number 13, the order in which the functions will be executed is indicated, first the middleware
function and then the myfunction
function.
Last updated