From 69a19e85c6390e08781644cbc1424dc914af76a7 Mon Sep 17 00:00:00 2001 From: chin Date: Wed, 9 Dec 2020 18:31:52 +0800 Subject: [PATCH] fix: No such file or directory The debug mongoose models json cause the server cannot run Remove the debug function --- models/mongodb/model/ImagingStudy.js | 2 +- models/mongodb/model/endpoint.js | 2 +- models/mongodb/model/organization.js | 2 +- models/mongodb/model/patients.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/models/mongodb/model/ImagingStudy.js b/models/mongodb/model/ImagingStudy.js index 0bd6a89..568316e 100644 --- a/models/mongodb/model/ImagingStudy.js +++ b/models/mongodb/model/ImagingStudy.js @@ -218,7 +218,7 @@ module.exports = function (mongodb) { } next(); }); - fs.writeFileSync("./data/imagingstudySchema.json" ,JSON.stringify (ImagingStudySchema.jsonSchema() , null ,4) , {flag: "w+"}); + // fs.writeFileSync("./data/imagingstudySchema.json" ,JSON.stringify (ImagingStudySchema.jsonSchema() , null ,4) , {flag: "w+"}); const ImagingStudy = mongodb.model('ImagingStudy', ImagingStudySchema); return ImagingStudy; } diff --git a/models/mongodb/model/endpoint.js b/models/mongodb/model/endpoint.js index b49f2d2..2234624 100644 --- a/models/mongodb/model/endpoint.js +++ b/models/mongodb/model/endpoint.js @@ -75,7 +75,7 @@ module.exports = function (mongodb) { delete result.__v; return result; } - fs.writeFileSync("./data/endpoint.json" ,JSON.stringify (endpointSchema.jsonSchema() , null ,4) , {flag: "w+"}); + //fs.writeFileSync("./data/endpoint.json" ,JSON.stringify (endpointSchema.jsonSchema() , null ,4) , {flag: "w+"}); let endpoint = mongodb.model('endpoint', endpointSchema , 'endpoint'); return endpoint; } diff --git a/models/mongodb/model/organization.js b/models/mongodb/model/organization.js index 898d2e9..f571947 100644 --- a/models/mongodb/model/organization.js +++ b/models/mongodb/model/organization.js @@ -61,7 +61,7 @@ module.exports = function (mongodb) { } return result; }) - fs.writeFileSync("./data/organization.json", JSON.stringify(organizationSchema.jsonSchema(), null, 4), { flag: "w+" }); + //fs.writeFileSync("./data/organization.json", JSON.stringify(organizationSchema.jsonSchema(), null, 4), { flag: "w+" }); const organization = mongodb.model('organization', organizationSchema, 'organization'); return organization; }; diff --git a/models/mongodb/model/patients.js b/models/mongodb/model/patients.js index b947058..884a664 100644 --- a/models/mongodb/model/patients.js +++ b/models/mongodb/model/patients.js @@ -85,7 +85,7 @@ module.exports = function(mongodb) { } return result; }) - fs.writeFileSync("./data/patient.json" ,JSON.stringify (patientsSchema.jsonSchema() , null ,4) , {flag: "w+"}); + //fs.writeFileSync("./data/patient.json" ,JSON.stringify (patientsSchema.jsonSchema() , null ,4) , {flag: "w+"}); const patients = mongodb.model('patients', patientsSchema); return patients; };