- Creazione "AbitareGliIblei"

- Mappa Interattiva con i markers
This commit is contained in:
Surya Paolo
2024-07-31 15:02:40 +02:00
parent 21862f87a1
commit d527f49c5e
2 changed files with 55 additions and 7 deletions

View File

@@ -89,10 +89,23 @@ const AttivitaSchema = new Schema(
},
descr: {
type: String,
},
},
coordinate_gps: {
type: String,
address: {
type: String,
default: '',
},
type: {
type: String,
enum: ['Point'], // Specifica il tipo, in questo caso solo 'Point'
required: true
},
coordinates: {
type: [Number], // L'array dovrebbe contenere lon e lat
required: true,
index: '2dsphere' // Indice geospaziale [lng, lat]
},
},
email: {
@@ -111,6 +124,7 @@ const AttivitaSchema = new Schema(
type: String,
},
//**ADDFIELD_ATTIVITA
},
...Reaction.getFieldsForReactions()
@@ -341,7 +355,7 @@ AttivitaSchema.statics.getProject = function (proj_add2) {
idSkill: 1,
idCity: 1,
logo: 1,
photos: 1,
photos: 1,
note: 1,
descr: 1,
website: 1,

View File

@@ -783,7 +783,8 @@ function startServer(app, port) {
let domains = [];
try {
domains = JSON.parse(process.env.DOMAINS);
if (process.env.DOMAINS)
domains = JSON.parse(process.env.DOMAINS);
} catch (error) {
console.error("Errore durante la conversione della stringa DOMAINS:", error);
}
@@ -799,9 +800,42 @@ function startServer(app, port) {
httpsServer.listen(domains[i].port);
}
} else {
const httpServer = http.createServer(app);
console.log('⭐️⭐️⭐️ HTTP server IN LOCALE : port', port);
httpServer.listen(port);
if (process.env.HTTPS_LOCALHOST === "true") {
let credentials = null;
try {
credentials = {
key: fs.readFileSync(process.env.PATH_CERT_KEY, 'utf8'),
cert: fs.readFileSync(process.env.PATH_SERVER_CRT, 'utf8'),
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
honorCipherOrder: true,
secureProtocol: 'TLSv1_2_method'
};
} catch (error) {
console.error('Errore durante la lettura dei file di certificazione, error:', error.message);
throw error;
}
if (credentials) {
const httpsServer = https.createServer(credentials, app);
console.log('⭐️⭐️⭐️ HTTPS server IN LOCALE : port', port);
httpsServer.listen(port);
} else {
httpServer = http.createServer(app);
if (httpServer) {
console.log('⭐️⭐️⭐️ HTTP server IN LOCALE : port', port);
httpServer.listen(port);
}
}
// console.log('credentials', credentials);
} else {
httpServer = http.createServer(app);
if (httpServer) {
console.log('⭐️⭐️⭐️ HTTP server IN LOCALE : port', port);
httpServer.listen(port);
}
}
}
} catch (e) {
console.log('error ' + e);