- risolto problema spazi vuoti in cima alla app
- risolto problema sulle card di telegram, immagini non alte uguali e non si vedono bene...
This commit is contained in:
@@ -36,17 +36,17 @@ const OrdersCart = require('../models/orderscart');
|
||||
|
||||
//GET cart
|
||||
router.get('/:userId', authenticate, async function (req, res, next) {
|
||||
let userId = req.params.userId;
|
||||
let idapp = req.user.idapp;
|
||||
return await Cart.getCartByUserId(userId, idapp)
|
||||
.then((cart) => {
|
||||
if (cart) return res.send({ code: server_constants.RIS_CODE_OK, cart });
|
||||
else return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Err', err);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null });
|
||||
});
|
||||
try {
|
||||
let userId = req.params.userId;
|
||||
let idapp = req.user.idapp;
|
||||
|
||||
const cart = await Cart.getCartByUserId(userId, idapp);
|
||||
if (cart) return res.send({ code: server_constants.RIS_CODE_OK, cart });
|
||||
else return res.send({ code: server_constants.RIS_CODE_OK, cart: null });
|
||||
} catch (err) {
|
||||
console.error('Err', err);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: null });
|
||||
}
|
||||
});
|
||||
|
||||
async function aggiornaCarrello(mycartpar, userId, idapp) {
|
||||
@@ -71,13 +71,13 @@ async function aggiornaCarrello(mycartpar, userId, idapp) {
|
||||
|
||||
//POST cart
|
||||
router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
let idapp = req.body.idapp;
|
||||
let userId = req.params.userId;
|
||||
let addqty = req.body.addqty;
|
||||
let subqty = req.body.subqty;
|
||||
let order = req.body.order;
|
||||
|
||||
try {
|
||||
let idapp = req.body.idapp;
|
||||
let userId = req.params.userId;
|
||||
let addqty = req.body.addqty;
|
||||
let subqty = req.body.subqty;
|
||||
let order = req.body.order;
|
||||
|
||||
let mycart = await Cart.getCartByUserId(userId, idapp);
|
||||
|
||||
if (!order) {
|
||||
|
||||
@@ -197,9 +197,6 @@ connectToDatabase(connectionUrl, options)
|
||||
// next(err);
|
||||
// });
|
||||
|
||||
// app.set('views', path.join(__dirname, 'views'));
|
||||
// app.set('view engine', 'pug');
|
||||
|
||||
// development error handler
|
||||
// will print stacktrace
|
||||
if (app.get('env') === 'development') {
|
||||
@@ -217,8 +214,6 @@ connectToDatabase(connectionUrl, options)
|
||||
console.log('*** PRODUCTION! ');
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'test') {
|
||||
}
|
||||
startServer(app, process.env.PORT);
|
||||
|
||||
// Use Routes
|
||||
@@ -802,6 +797,9 @@ connectToDatabase(connectionUrl, options)
|
||||
'https://localhost:8088',
|
||||
'https://localhost:8099',
|
||||
'https://localhost:8094',
|
||||
'https://192.168.8.182',
|
||||
'https://192.168.8.182:8084/',
|
||||
'http://192.168.8.182:8084/',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -831,7 +829,7 @@ connectToDatabase(connectionUrl, options)
|
||||
|
||||
const allowedOrigins = buildAllowedOrigins(domains, domainsAllowed, isProduction);
|
||||
|
||||
const originValidator = (origin, callback) => {
|
||||
let originValidator = (origin, callback) => {
|
||||
if (!origin) {
|
||||
// console.log('✅ Origin undefined or empty — allowing');
|
||||
return callback(null, true);
|
||||
@@ -850,6 +848,10 @@ connectToDatabase(connectionUrl, options)
|
||||
return callback(new Error('CORS non permesso per questa origine'), false);
|
||||
};
|
||||
|
||||
if (app.get('env') === 'development') {
|
||||
originValidator = (_origin, callback) => callback(null, true);
|
||||
}
|
||||
|
||||
return {
|
||||
origin: originValidator,
|
||||
credentials: true,
|
||||
@@ -951,7 +953,7 @@ connectToDatabase(connectionUrl, options)
|
||||
};
|
||||
|
||||
const httpsServer = https.createServer(credentials, app);
|
||||
httpsServer.listen(port);
|
||||
httpsServer.listen(port, '0.0.0.0');
|
||||
console.log('⭐️ HTTPS server running locally on port', port);
|
||||
return httpsServer;
|
||||
} catch (error) {
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.2.75
|
||||
1.2.76
|
||||
Reference in New Issue
Block a user