Consume a Custom-Middleware
Consume a custom-middleware to use in your project.
const middleware = require('linkapi-sdk/core/middleware');
const result = await middleware.use('yourMid', 'param1', 'param2');
Get a custom-middleware file and store in a variable. Call the method when you want.
const middleware = require('linkapi-sdk/core/middleware');
const yourMid = await middleware.get('yourMid');
const result1 = await yourMid('param1'); // first call
const result2 = await yourMid('param2'); // second call
Updated over 3 years ago