const fastify = require("fastify"); const createConnectionController = require("../controllers/createConnectionController"); module.exports = function (fastify, opts, next) { fastify.route({ method: "POST", url: "/api/createConnections", schema: { tags: ["Connections"], description: "This is for cretae New Connection", summary: "This is for cretae New Connection.", body: { type: "object", properties: { source: { type: "string" }, inputConnections: { type: "array", maxItems: 2, items: { type: "object", properties: { inputConnections: { type: "string", default: null }, }, }, }, outputConnections: { type: "array", maxItems: 2, items: { type: "object", properties: { outputConnections: { type: "string", default: null }, }, }, }, }, }, security: [ { basicAuth: [], }, ], }, preHandler: fastify.auth([fastify.authenticate]), handler: createConnectionController.createConnections, // onResponse: (request, reply) => { // validationHandler.sendPhoneVerificationCode(request, reply); // }, //onResponse: validationHandler.sendPhoneVerificationCode, }); next(); }