- Catalogo: Aggiunta di Schede

This commit is contained in:
Surya Paolo
2024-10-31 23:22:46 +01:00
parent fa1a2a7cdb
commit 3bdab927b6
9 changed files with 275 additions and 15 deletions

View File

@@ -106,6 +106,7 @@ myLoad().then(ris => {
require('./models/newstosent');
require('./models/mypage');
require('./models/myelem');
require('./models/myscheda');
require('./models/bot');
require('./models/calzoom');
const mysql_func = require('./mysql/mysql_func');
@@ -805,7 +806,7 @@ function startServer(app, port) {
const NOCORS = false;
const CORS_ENABLE_FOR_ALL_SITES = false;
const ISDEBUG = true;
const ISDEBUG = false;
let corsOptions = {};
@@ -842,7 +843,7 @@ function startServer(app, port) {
}
},*/
credentials: false,
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'PATCH'],
allowedHeaders: [
'Origin',
'X-Requested-With',
@@ -861,6 +862,7 @@ function startServer(app, port) {
// Applica CORS come primo middleware
app.use(cors(corsOptions));
// HO AGGIUNTO QUESTA RIGA PER IL CORS !!!!!!!
app.use(express.json()); // Middleware per il parsing del corpo JSON
// Gestione specifica delle richieste OPTIONS