diff --git a/.env.example b/.env.example index b5fc5db..48d1098 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,11 @@ TYPEDB = -DB = +DB = asinea -USERDB = +USERDB = local -PASSDB = +PASSDB = 123 -HOSTDB = +HOSTDB = localhost -PORT = +PORT = 3000 diff --git a/package-lock.json b/package-lock.json index 6eca681..678a280 100644 --- a/package-lock.json +++ b/package-lock.json @@ -231,6 +231,11 @@ "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==" }, + "bignumber.js": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", + "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" + }, "binary": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz", @@ -1563,6 +1568,17 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "mysql": { + "version": "2.18.1", + "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.18.1.tgz", + "integrity": "sha512-Bca+gk2YWmqp2Uf6k5NFEurwY/0td0cpebAucFpY/3jhrwrVGuxU2uQFCHjU19SJfje0yQvi+rVWdq78hR5lig==", + "requires": { + "bignumber.js": "9.0.0", + "readable-stream": "2.3.7", + "safe-buffer": "5.1.2", + "sqlstring": "2.3.1" + } + }, "needle": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.2.tgz", @@ -2072,6 +2088,11 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "optional": true }, + "sqlstring": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", + "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" + }, "static-eval": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.3.tgz", diff --git a/package.json b/package.json index 6c24331..56e37df 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "express": "^4.17.1", "express-fileupload": "^1.1.6", "json2csv": "^4.5.4", + "mysql": "^2.18.1", "pdfkit": "^0.11.0", "qr-image": "^3.2.0", "randomstring": "^1.1.5", diff --git a/routes/index.js b/routes/index.js index 9d1f9d9..c62d453 100644 --- a/routes/index.js +++ b/routes/index.js @@ -16,4 +16,5 @@ app.use(require('./descargar_comprobante')); app.use(require('./descargar_carta')); app.use(require('./crear_ccv')); app.use(require('./eliminar_persona')); +app.use(require('./post_factura')); module.exports = app; \ No newline at end of file diff --git a/routes/post_factura.js b/routes/post_factura.js index e00e21f..69136aa 100644 --- a/routes/post_factura.js +++ b/routes/post_factura.js @@ -40,9 +40,10 @@ app.get('/post_factura', async(req, res) => { return; } catch (err) { console.log(err); - return res.status(400).json({ error: true, msj: "Error al traer los datos" }); + return res.status(400).json({ error: true, msj: "Error al insertar los datos" }); } }); + module.exports = app; \ No newline at end of file