Auto select Mongoose connect String

This commit is contained in:
Vincze József 2023-10-17 13:53:41 +02:00
parent 040b7d0660
commit 1e70fb7f5a
2 changed files with 14 additions and 4 deletions

12
app.js
View File

@ -27,9 +27,19 @@ const { XMLParser, XMLBuilder, XMLValidator} = require("fast-xml-parser/src/fxp"
const fss = require('fs');
global.currentWorkNumber=0;
mongoose.Promise = global.Promise;
var os = require('os');
console.log(os.type());
if (os.type()==='Windows_NT')
{
mongoose.connect('mongodb://admin:MarkoSn1Pb1@iotechnic.eu:27017/nodekb', { useFindAndModify: false , useNewUrlParser: true,useUnifiedTopology: true });
}
else
{
mongoose.connect('mongodb://admin:MarkoSn1Pb1@localhost/nodekb', { useFindAndModify: false , useNewUrlParser: true,useUnifiedTopology: true });
}
//mongoose.connect('mongodb://nodeUser:Kutafaja1234@localhost/nodekb',{ useMongoClient: true,useFindAndModify: false , useNewUrlParser: true,useUnifiedTopology: true });
//mongoose.connect('mongodb://admin:MarkoSn1Pb1@iotechnic.eu:27017/nodekb',{ useMongoClient: true });
mongoose.connect('mongodb://admin:MarkoSn1Pb1@iotechnic.eu:27017/nodekb', { useFindAndModify: false , useNewUrlParser: true,useUnifiedTopology: true });
let db = mongoose.connection;
//var fsa = require("fs-iconv");
//import * as fss from 'fs-iconv';

View File

@ -93,9 +93,9 @@ block content
a(href='#',data-value='2022') 2023
li
a(href='#',data-value='') Mind
a.btn.btn-primary.col-sm-1(type='button',href='/employee/WTALL',value='Könyvelésre') Könyvelésre
a.btn.btn-primary.col-sm-21(type='button',href='/employee/WTALL2',value='Jelenléti személyenként') Jelenléti személyenként
a.btn.btn-primary.col-sm-1(type='button',href='/employee/tst',value='TST') TST
a.btn.btn-primary.col-sm-1(type='button',disabled,href='/employee/WTALL',value='Könyvelésre') Könyvelésre
a.btn.btn-primary.col-sm-21(type='button',disabled,href='/employee/WTALL2',value='Jelenléti személyenként') Jelenléti személyenként
a.btn.btn-primary.col-sm-1(type='button',disabled,href='/employee/tst',value='TST') TST
a.btn.btn-primary.col-sm-1(type='button',href='/gantt',value='Idővonal') Idővonal
a.btn.btn-warning.col-sm-1(type='button',href='#',data-toggle='modal', data-target='#refuelModal') Tankolás