refactor(server, connect): default data in config.js
This commit is contained in:
parent
8236926a6c
commit
31affdc16e
|
@ -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
|
||||
});
|
||||
|
||||
|
|
12
server.js
12
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}`);
|
||||
});
|
||||
|
|
Reference in New Issue