master
bhaskar 2 years ago
parent ac62f7fced
commit b4d7e90013

@ -49,8 +49,7 @@
<!-- Do not commit this file into the server , ignore it by adding it to .gitignore --> <!-- Do not commit this file into the server , ignore it by adding it to .gitignore -->
<!----------------**************************---------------------> <!----------------**************************--------------------->
<rapi-doc <rapi-doc
spec-url="http://35.207.198.4:5000/documentation/json" spec-url="http://35.207.198.4:3000/documentation/json"
show-header = 'false' show-header = 'false'
allow-authentication ="true" allow-authentication ="true"
> >

@ -15,8 +15,7 @@ exports.options = {
// We have to change this beacause this is running on local // We have to change this beacause this is running on local
// we have to run on this on swagger // we have to run on this on swagger
//host: "localhost:5000", //Devlopemnt host on lcoal //host: "localhost:5000", //Devlopemnt host on lcoal
host: "35.207.198.4:3000", //Production for swagger
host: "35.207.198.4:5000", //Production for swagger
schemes: ["http"], schemes: ["http"],
consumes: ["application/json"], consumes: ["application/json"],
produces: ["application/json"], produces: ["application/json"],

@ -27,7 +27,7 @@ exports.createConnections = async (req, body) => {
inputConnections: connection.inputConnections, inputConnections: connection.inputConnections,
input_type: connection.input_type, input_type: connection.input_type,
motor_status: connection.motor_status || "0", motor_status: connection.motor_status || "0",
inputismotor: connection.inputismotor // default to false if not specified inputismotor: connection.inputismotor || false // default to false if not specified
}; };
}); });
} }
@ -38,7 +38,7 @@ exports.createConnections = async (req, body) => {
return { return {
outputConnections: connection.outputConnections, outputConnections: connection.outputConnections,
output_type: connection.output_type, output_type: connection.output_type,
outputismotor: connection.outputismotor // default to false if not specified outputismotor: connection.outputismotor || false // default to false if not specified
}; };
}); });
} }

@ -360,7 +360,7 @@ const start = async () => {
try { try {
await fastify.listen(5000, "0.0.0.0"); await fastify.listen(3000, "0.0.0.0");
fastify.log.info(`listening on ${fastify.server.address().port}`); fastify.log.info(`listening on ${fastify.server.address().port}`);
fastify.log.info(`server listening on ${fastify.config}`); fastify.log.info(`server listening on ${fastify.config}`);
} catch (err) { } catch (err) {

@ -48,7 +48,7 @@ const tanksSchema = new mongoose.Schema({
{ {
inputConnections: { type: String }, inputConnections: { type: String },
input_type: { type: String }, input_type: { type: String },
inputismotor: { type: Boolean }, inputismotor: { type: Boolean, default: false },
motor_status: { type: String, default: "0" } motor_status: { type: String, default: "0" }
} }
], ],
@ -56,7 +56,7 @@ const tanksSchema = new mongoose.Schema({
{ {
outputConnections: { type: String }, outputConnections: { type: String },
output_type: { type: String }, output_type: { type: String },
outputismotor: { type: Boolean }, outputismotor: { type: Boolean, default: false },
motor_status: { type: String, default: "0" } motor_status: { type: String, default: "0" }
} }
] ]

@ -182,7 +182,7 @@ module.exports = function (fastify, opts, next) {
properties: { properties: {
inputConnections: { type: "string", default: null }, inputConnections: { type: "string", default: null },
type: { type: "string", default: null }, type: { type: "string", default: null },
inputismotor: { type: "boolean"}, inputismotor: { type: "boolean", default: false },
}, },
}, },
}, },
@ -194,7 +194,7 @@ module.exports = function (fastify, opts, next) {
properties: { properties: {
outputConnections: { type: "string", default: null }, outputConnections: { type: "string", default: null },
type: { type: "string", default: null }, type: { type: "string", default: null },
outputismotor: { type: "boolean" }, outputismotor: { type: "boolean", default: false },
}, },
}, },
}, },

Loading…
Cancel
Save