Skip to content

Commit

Permalink
upload connection vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
coxmau77 committed Jul 8, 2024
1 parent 7755fc2 commit 536c252
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions db/bd.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
require('dotenv').config();
const mySQL = require('mysql2');

// Conexion local
const connection = mySQL.createConnection({
host: "localhost",
user: "root",
password: "admin123",
database: "online_shop",
port: 3303
});
// // Conexion para deploy
// // Conexion local
// const connection = mySQL.createConnection({
// host: process.env.DB_HOST,
// user: process.env.DB_USER,
// password: process.env.DB_PASSWORD,
// database: process.env.DB_NAME,
// port: process.env.DB_HOST
// host: "localhost",
// user: "root",
// password: "admin123",
// database: "online_shop",
// port: 3303
// });
// Conexion para deploy
const connection = mySQL.createConnection({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
port: process.env.DB_HOST
});

connection.connect(error => {
if (error) {
Expand Down
4 changes: 2 additions & 2 deletions public/js/shop.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
console.log("Aqui vemos y agregamos productos");

document.addEventListener('DOMContentLoaded', () => {
console.log("Aqui vemos y agregamos productos");

const listaDeProductos = document.getElementById('product_list');
const editarProductoForm = document.getElementById('editarProductoForm');
Expand Down Expand Up @@ -46,7 +46,7 @@ document.addEventListener('DOMContentLoaded', () => {
// Listar todos los productos
async function listarProductos() {

const response = await fetch('product/all');
const response = await fetch('/product/all');

// Manejo de errores HTTP
if (!response.ok) {
Expand Down

0 comments on commit 536c252

Please sign in to comment.