You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
57 lines
1.8 KiB
57 lines
1.8 KiB
3 years ago
|
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();
|
||
|
}
|