- Creazione "AbitareGliIblei"
- Mappa Interattiva con i markers
This commit is contained in:
@@ -92,7 +92,20 @@ const AttivitaSchema = new Schema(
|
|||||||
},
|
},
|
||||||
|
|
||||||
coordinate_gps: {
|
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: {
|
email: {
|
||||||
@@ -111,6 +124,7 @@ const AttivitaSchema = new Schema(
|
|||||||
type: String,
|
type: String,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//**ADDFIELD_ATTIVITA
|
//**ADDFIELD_ATTIVITA
|
||||||
},
|
},
|
||||||
...Reaction.getFieldsForReactions()
|
...Reaction.getFieldsForReactions()
|
||||||
|
|||||||
@@ -783,7 +783,8 @@ function startServer(app, port) {
|
|||||||
let domains = [];
|
let domains = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
domains = JSON.parse(process.env.DOMAINS);
|
if (process.env.DOMAINS)
|
||||||
|
domains = JSON.parse(process.env.DOMAINS);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Errore durante la conversione della stringa DOMAINS:", error);
|
console.error("Errore durante la conversione della stringa DOMAINS:", error);
|
||||||
}
|
}
|
||||||
@@ -799,9 +800,42 @@ function startServer(app, port) {
|
|||||||
httpsServer.listen(domains[i].port);
|
httpsServer.listen(domains[i].port);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const httpServer = http.createServer(app);
|
if (process.env.HTTPS_LOCALHOST === "true") {
|
||||||
console.log('⭐️⭐️⭐️ HTTP server IN LOCALE : port', port);
|
let credentials = null;
|
||||||
httpServer.listen(port);
|
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) {
|
} catch (e) {
|
||||||
console.log('error ' + e);
|
console.log('error ' + e);
|
||||||
|
|||||||
Reference in New Issue
Block a user