Skip to content

addAdvanceHandler

Appends an advance request handler to the list of handlers managed by the application.

Usage

Below is a simple example of adding an advance handler that only logs the request received.

import { createApp } from "@deroll/app";
 
// create application
const app = createApp({ url: "http://localhost:5004" });
 
app.addAdvanceHandler(async ({ metadata, payload }) => { 
    console.log(metadata, payload); 
    return "accept"; 
}); 

Returns

void

Parameters

Type: AdvanceRequestHandler

An async function that receives an object with the request metadata and payload, and returns either accept or reject.