- Creazione "AbitareGliIblei"
- Mappa Interattiva con i markers
This commit is contained in:
@@ -92,7 +92,20 @@ const AttivitaSchema = new Schema(
|
||||
},
|
||||
|
||||
coordinate_gps: {
|
||||
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()
|
||||
|
||||
@@ -783,6 +783,7 @@ function startServer(app, port) {
|
||||
let domains = [];
|
||||
|
||||
try {
|
||||
if (process.env.DOMAINS)
|
||||
domains = JSON.parse(process.env.DOMAINS);
|
||||
} catch (error) {
|
||||
console.error("Errore durante la conversione della stringa DOMAINS:", error);
|
||||
@@ -799,10 +800,43 @@ function startServer(app, port) {
|
||||
httpsServer.listen(domains[i].port);
|
||||
}
|
||||
} else {
|
||||
const httpServer = http.createServer(app);
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user