From 79a014ea04ad5a77fba8881a5dc4f3dc4eda7719 Mon Sep 17 00:00:00 2001 From: Cucho145U <170748@unsaac.edu.pe> Date: Tue, 15 Dec 2020 21:50:35 -0500 Subject: [PATCH 1/2] Prueba1 Solucion para poder correr el programa --- bin/www | 2 +- configs/mongo-config.js | 3 ++- package-lock.json | 4 ++-- routes/index.js | 4 ++-- seed/index.js | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/www b/bin/www index 6100eaf..b1e0992 100755 --- a/bin/www +++ b/bin/www @@ -13,7 +13,7 @@ var PORT = process.argv[2]&&process.argv[2].slice(-4) * Get port from environment and store in Express. */ -var port = normalizePort(process.env.PORT || PORT || '3000'); +var port = normalizePort(process.env.PORT || PORT || '4000'); app.set('port', port); /** diff --git a/configs/mongo-config.js b/configs/mongo-config.js index 3690269..1d27e4a 100644 --- a/configs/mongo-config.js +++ b/configs/mongo-config.js @@ -1 +1,2 @@ -// export mongodb url +const direccion="mongodb://localhost:27017/[DataEComerce][DataCollection]"; +module.exports = direccion; diff --git a/package-lock.json b/package-lock.json index 51fcd06..69b27d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "myapp", - "version": "0.0.0", + "name": "ecommerce-nodejs", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/routes/index.js b/routes/index.js index 005508b..247ab55 100644 --- a/routes/index.js +++ b/routes/index.js @@ -164,8 +164,8 @@ router.get('/filter', function (req, res, next) { //GET /checkout router.get('/checkout/:cartId', ensureAuthenticated, function (req, res, next) { const cartId = req.params.cartId - const frontURL = 'https://zack-ecommerce-reactjs.herokuapp.com' - // const frontURL = 'http://localhost:3000' + //const frontURL = 'https://zack-ecommerce-reactjs.herokuapp.com' + const frontURL = 'http://localhost:3000' Cart.getCartById(cartId, function (err, c) { if (err) return next(err) diff --git a/seed/index.js b/seed/index.js index e2d9001..2672428 100644 --- a/seed/index.js +++ b/seed/index.js @@ -185,7 +185,7 @@ var products = category: 'Girl', date: 1597962874736 }), - new Product({ + /*new Product({ // _id: "5f3efb0d034bec1b28de7238", imagePath: 'https://static.zara.net/photos///2020/I/0/3/p/3183/700/800/2/w/560/3183700800_1_1_1.jpg?ts=1597336424462', title: 'PADDED BOMBER', @@ -197,7 +197,7 @@ var products = department: 'Kids', category: 'Boy', date: 1597962874736 - }), + }),*/ ]; for (let i = 0; i < products.length; i++) { From 9acff998f13e909aaf52c5a3080c34e5c4adb076 Mon Sep 17 00:00:00 2001 From: ManuelVelarde2212 <72516305+ManuelVelarde2212@users.noreply.github.com> Date: Mon, 21 Dec 2020 16:53:55 -0500 Subject: [PATCH 2/2] Update index.js --- seed/index.js | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/seed/index.js b/seed/index.js index 2672428..9f898d5 100644 --- a/seed/index.js +++ b/seed/index.js @@ -11,25 +11,25 @@ mongoose.connect(mongoConfig, { useNewUrlParser: true, useCreateIndex: true, }); var categories = [ new Category({ - categoryName: 'Basics' + categoryName: 'Basicos' }), new Category({ - categoryName: 'Blazer' + categoryName: 'Chaqueta' }), new Category({ - categoryName: 'Knitwear' + categoryName: 'Prendas de punto' }), new Category({ categoryName: 'Jeans' }), new Category({ - categoryName: 'Jackets' + categoryName: 'Campera' }), new Category({ - categoryName: 'Girl' + categoryName: 'Niña' }), new Category({ - categoryName: 'Boy' + categoryName: 'Niño' }) ] @@ -44,17 +44,17 @@ for (let i = 0; i < categories.length; i++) { var departments = [ new Department({ - departmentName: 'Women', - categories: 'Basics,Blazer' + departmentName: 'Mujeres', + categories: 'Basicos,Chaqueta' }), new Department({ - departmentName: 'Men', - categories: 'Knitwear,Jeans,Jackets' + departmentName: 'Varones', + categories: 'Prendas de punto,Jeans,Campera' }), new Department({ - departmentName: 'Kids', - categories: 'Girl,Boy' + departmentName: 'Niños', + categories: 'Niña,Niño' }) ] @@ -77,8 +77,8 @@ var products = color: 'Gray', size: 'XS,S,M', quantity: 10, - department: 'Women', - category: 'Basics', + department: 'Mujeres', + category: 'Basicos', date: 1581397200000 }), new Product({ @@ -90,8 +90,8 @@ var products = color: 'Black', size: 'XS,S,XL', quantity: 15, - department: 'Women', - category: 'Basics', + department: 'Mujeres', + category: 'Basicos', date: 1597885814264 }), new Product({ @@ -103,21 +103,21 @@ var products = color: 'White', size: 'XS', quantity: 90, - department: 'Women', - category: 'Basics', + department: 'Mujeres', + category: 'Basicos', date: 1581397200000 }), new Product({ _id: "5bedf55bc14d7822b39d9d4b", imagePath: 'https://static.zara.net/photos///2018/I/0/1/p/8197/757/093/4/w/1920/8197757093_2_2_1.jpg?ts=1538393944729', - title: 'Belted Plaid Blazer', - description: 'Flowy blazer with lapel collar and long sleeves. Self belt. Chest patch pockets and welt pockets at hip. Front double-breasted button closure.', + title: 'Belted Plaid Chaqueta', + description: 'Flowy Chaqueta with lapel collar and long sleeves. Self belt. Chest patch pockets and welt pockets at hip. Front double-breasted button closure.', price: 79.99, color: 'Black', size: 'S,M,L', quantity: 4, - department: 'Women', - category: 'Blazer', + department: 'Mujeres', + category: 'Chaqueta', date: 1581397200000 }), new Product({ @@ -129,8 +129,8 @@ var products = color: 'Orange', size: 'M,L', quantity: 5, - department: 'Men', - category: 'Knitwear', + department: 'Varones', + category: 'Prendas de punto', date: 1597885814264 }), new Product({ @@ -142,7 +142,7 @@ var products = color: 'Dark Blue', size: 'M,L', quantity: 80, - department: 'Men', + department: 'Varones', category: 'Jeans', date: 1597885814264 }), @@ -155,7 +155,7 @@ var products = color: 'Light Blue', size: 'XS,S,M', quantity: 8, - department: 'Men', + department: 'Varones', category: 'Jeans', date: 1581397200000 }), @@ -168,8 +168,8 @@ var products = color: 'Brown', size: 'XS,M,XL', quantity: 12, - department: 'Men', - category: 'Jackets', + department: 'Varones', + category: 'Campera', date: 1581397200000 }), new Product({ @@ -181,11 +181,11 @@ var products = color: 'OYSTER WHITE', size: 'XS,M', quantity: 23, - department: 'Kids', - category: 'Girl', + department: 'Niños', + category: 'Niña', date: 1597962874736 }), - /*new Product({ + new Product({ // _id: "5f3efb0d034bec1b28de7238", imagePath: 'https://static.zara.net/photos///2020/I/0/3/p/3183/700/800/2/w/560/3183700800_1_1_1.jpg?ts=1597336424462', title: 'PADDED BOMBER', @@ -194,10 +194,10 @@ var products = color: 'BLACK ', size: 'XS', quantity: 23, - department: 'Kids', - category: 'Boy', + department: 'Niños', + category: 'Niño', date: 1597962874736 - }),*/ + }), ]; for (let i = 0; i < products.length; i++) {