diff --git a/db/connect.js b/db/connect.js index 03aef67..b4b4836 100644 --- a/db/connect.js +++ b/db/connect.js @@ -1,12 +1,12 @@ const mysql = require('mysql'); const config = require('../config'); -let con = mysql.createConnection({ - host: 'test-db.verdnatura.es', // 'test-db.verdnatura.es', - database: 'vn', - user: config.userDev, - password: config.passwordDev, - port: 3307, +const con = mysql.createConnection({ + host: config.db.user, // 'test-db.verdnatura.es', + port: config.db.port, + database: config.db.database, + user: config.db.user, + password: config.db.password, insecureAuth: true }); diff --git a/server.js b/server.js index b7ea7ed..abb3ec4 100644 --- a/server.js +++ b/server.js @@ -1,12 +1,11 @@ const express = require('express'); -const app = express(); -const ip = require('ip'); -const ipAddress = ip.address(); -const port = 7777; const logIn = require('./methods/logIn'); const con = require('./db/connect'); +const config = require('./config'); +const app = express(); const dataLogIn = logIn.info; + exports.dataLogIn = dataLogIn; con.con.connect(function(err) {}); @@ -16,7 +15,6 @@ app.use('/bindShelving', require('./methods/bindShelvingTag')); // smartTagFk, s app.use('/insertTicket', require('./methods/bindTicketShelving')); // collectionFk app.use('/flashOn', require('./methods/flashOn')); -app.listen(port, () => { - console.info(`http://localhost:${port}`); - console.log(`Network access via: ${ipAddress}:${port}!`); +app.listen(config.port, () => { + console.info(`http://localhost:${config.port}`); });