LuvDaSun/SkiffaGenerator

support registering multiple handlers in one command

Closed this issue · 0 comments

This would enable the following scenario:

Handlers (operation and authentication) are defined in files and exported, like this:

export const blaOperationHandler: BlaOperationHandler = async () => {
  // handle things
}

Then in the index of the folder where this handler lives we have:

export * from "./bla.js"; // this is the file where the handler lived
export * from "./blie.js"; // other handler
export * from "./blup.js"; // and another handle

And now we can register all handlers like this

import * as operationHandlers from "./operation-handlers/index.js";

server.registerOperationHandlers(operationHandlers);

This would make for a scalable operationhandlers api